From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20110429165653.1CB9CB827@mail.bitblocks.com> References: <20110429165653.1CB9CB827@mail.bitblocks.com> Date: Fri, 29 Apr 2011 10:28:06 -0700 Message-ID: From: John Floren To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] An acme question Topicbox-Message-UUID: d9165220-ead6-11e9-9d60-3106f5b1d025 On Fri, Apr 29, 2011 at 9:56 AM, Bakul Shah wrote: > 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]] } > =A0 =A0 =A0 =A0 =A0 1 2 =A0 3456 =A0 =A0 =A0 =A0 =A0 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? =A0I took a quick look but > couldn't immediately see how. =A0If doable, how would I go about > it? =A0I 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 > > Acme can already do most of those things, except that when you double click on the space between two words ("foo bar"). Since you can't really click on a character, rather you can only click between two characters, it ends up selecting the word rather than the phrase. I personally think this is quite ok. John