9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: jacekm@dobremiasto.net (Jacek Masiulaniec)
Subject: [9fans] acme: copy selection to new window
Date: Sun, 27 Nov 2011 15:03:37 +0000	[thread overview]
Message-ID: <CA+BaOWyyPrXJkHm6JeZbkuVA-s2Yvo5WJzRTQ0Eg9tKy8vBm0w@mail.gmail.com> (raw)
In-Reply-To: <CA+BaOWwkgjxhBVVOzHY3qGQYBQEzyhRjeY5yTrHinwndohOiSQ@mail.gmail.com>

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



       reply	other threads:[~2011-11-27 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+BaOWwkgjxhBVVOzHY3qGQYBQEzyhRjeY5yTrHinwndohOiSQ@mail.gmail.com>
2011-11-27 15:03 ` Jacek Masiulaniec [this message]
2011-11-28  1:41   ` Akshat Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+BaOWyyPrXJkHm6JeZbkuVA-s2Yvo5WJzRTQ0Eg9tKy8vBm0w@mail.gmail.com \
    --to=jacekm@dobremiasto.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).