Re: Thoughts on sweet-expression editor modes (including ParEdit operations)
David A. Wheeler 09 Aug 2013 04:06 UTC
On Thu, 8 Aug 2013 23:38:08 -0400, Alexey Radul <xxxxxx@gmail.com> wrote:
> The one trick is, in
> |foo
> ! bar
> does forward-<anything>-sexp scope over just foo, or all of foo and
> bar? With actual s-expressions, there would be an explicit open paren
> there, so whether the cursor was in front of or behind it would
> determine the answer. The immortality of having implemented an
> excellent editor mode awaits anyone who can solve this problem (in a
> coherent and useful way).
There are probably lots of ways to address it; I suspect experimentation
would be needed to find a good approach (I'm sure there'd never
be universal agreement).
One approach might be to pick a default scope, and then define some
other key that can change the scope. Maybe a "shorten" prefix, or a
"do-that-last-operation-but-use-the-other-scope-instead" key.
For example, if it's not clear if it's "before" or "after" the implied paren,
pick one as the default, and define a prefix to use the other one.
Another would be to define a few keys for *selecting* a scope
(that would then highlight the scope), and then separately define keys
to do certain operations on the scope. That might be easier to
get used to, since there'd be a visual cue.
--- David A. Wheeler