From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] An acme question
Date: Fri, 29 Apr 2011 09:56:53 -0700 [thread overview]
Message-ID: <20110429165653.1CB9CB827@mail.bitblocks.com> (raw)
Here's something for a brief respite from linux bashing....
In acme, at present a single click positions the cursor, a
double click selects either the word under the cursor or the
entire line, depending on the cursor position.
What I would like to do is to the change logic as follows: If
you double *on* a word, the word is selected. If you double
click on white space or a bracket, a whole block is selected,
where a block is defined by matching brackets -- (), {} or [].
This property should be settable on a per window basis.
Example: given
{ fee [({ foo bar}) [and so on]] }
1 2 3456 7
Double clicking at 1 selects foo,
at 2 or 3 selects the phrase { foo bar},
at 4 selects the phrase ({ foo bar}),
at 5 selects the phrase [({ foo bar}) [and so on]],
at 6 selects the phrase [and so on],
at 7 selects the entire { fee [({ foo bar}) [and so on]] } etc.
Note: a block need not fit on one line.
A further enhancement: doubleclicking in a selected block
expands the selection to the surrounding block, without moving
the cursor.
Is this doable or too painful? I took a quick look but
couldn't immediately see how. If doable, how would I go about
it? I was thinking of keeping a list of matched string pairs
(REs might be too powerful) and look for one of left strings
earlier in the file. When one is found, look for the matching
right string later in the file. If none found, select to the
very end.
Surely someone has already tried this?
Thanks,
--bakul
next reply other threads:[~2011-04-29 16:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 16:56 Bakul Shah [this message]
2011-04-29 17:16 ` ron minnich
2011-04-29 17:30 ` Bakul Shah
2011-04-29 17:28 ` John Floren
2011-04-29 18:28 ` Bakul Shah
2011-04-29 21:39 ` smiley
2011-04-29 21:47 ` ron minnich
2011-04-30 7:06 ` Bakul Shah
2011-04-30 12:33 ` erik quanstrom
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=20110429165653.1CB9CB827@mail.bitblocks.com \
--to=bakul@bitblocks.com \
--cc=9fans@9fans.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).