emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shift-movement selection


From: Thomas Lord
Subject: Re: Shift-movement selection
Date: Wed, 12 Mar 2008 15:00:19 -0700
User-agent: Thunderbird 1.5.0.5 (X11/20060808)

Richard Stallman wrote:
    An idea:  Shift-select has pretty close to the same
    "semantics" as recursive edits, when viewed from
    the point of view of an emacs interaction loop.

I have to say they don't seem very similar to me
in their behavior.



Maybe a better way to say it:

"Shift-select" strikes me as a single command.   There
should be an interactive "shift-select" command.

That command takes the sequence that invoked it and,
if it is shifted, removes the shift modifier and looks up
the binding, then runs that command.  After the command
completes, shift-select updates the "shift-selected region".

The shift-select command then enters a loop, reading
key-sequences against the current key-maps.   If a
key-sequence is read that maps to the shift-select command
itself, then again, the shift is removed, the binding
checked again, the new command recursively invoked,
and the shift-select loop continues.

Otherwise, normally, the shift-select loop exits.
As an exception, functions can set a flag that will
cause shift-select to keep looping (after clearing
the flag).

Finally, add a higher-order command generator:

  (shift-select-variant 'some-command)

which returns a function that, when invoked, sets the
flag that keeps select-mode going (or enters select mode)
and then interactively invokes "some-command".

Default bindings to shift-select itself do most of the work.

Further customization can be done by binding sequences
to either shift-select or to some (shift-select-variant 'X).

No?

A nice feature would be an "interactive" declaration
(as someone mentioned) that, in this model, would set
the shift-mode-continue flag.   That way, commands could
be easily written that would only continue shift mode
if they are called interactively.

I'm sorry if I'm misunderstanding the problem but would
appreciate knowing *how* I'm misunderstanding it.

-t






reply via email to

[Prev in Thread] Current Thread [Next in Thread]