From mboxrd@z Thu Jan 1 00:00:00 1970 From: jacekm@dobremiasto.net (Jacek Masiulaniec) Date: Sun, 27 Nov 2011 15:03:37 +0000 Subject: [9fans] acme: copy selection to new window In-Reply-To: References: Message-ID: Topicbox-Message-UUID: 4824a568-ead7-11e9-9d60-3106f5b1d025 In plan9port acme, I'd like a command to copy selected text into new window. Here's rc implementation: % cat >/tmp/copy #!/usr/bin/env rc . $PLAN9/lib/acme.rc winctl 'addr=dot' winread data >/tmp/selection @{ ? ? ? ?newwindow ? ? ? ?cat /tmp/selection | winwrite body } % Consider the scenario: (1) Create a window that reads: foo bar baz (2) Add tag command /tmp/copy. (3) Select "bar". (4) Execute /tmp/copy. I expect new window to contain only the text "bar". In reality, the window contains "bar", and the unexpected "baz". Where's the problem? Thanks. Jacek