[Top][All Lists]
[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 16:59:35 -0700 |
User-agent: |
Thunderbird 1.5.0.5 (X11/20060808) |
Maybe it's even simpler than an i-search-like recursive
edit:
I'm not certain how CUA mode works in particular but
"shift-mark mode" in the abstract is a very logical
extension of Emacs' mark-stack model with the added
benefit that it "works like Windows users expect":
Emacs by default lets you push and pop marks on
the stack.
The shift-mark mode concept seems to me to be the
idea of "tentatively" pushing a mark on the mark stack.
It requires a two-phase commit from the user to turn
that into a first-class mark and the default outcome is
to abandon the tentative mark.
To "enter shift-mark mode" is to push a tentative mark.
From this point on, commands behave as if a mark was
pushed -- but this is a tentative mark and could go away
easily between any two commands.
After pushing a tentative mark, the user edits as normal
with that mark in effect -- but with a catch. There is
a post-command hook installed that, unless some flag
is flipped by the last command, will discard the tentative
mark.
By default, we want a shifted key-sequence to mean
the same thing as the un-shifted sequence, except that
the flag is flipped and so the tentative mark stays on
the stack. A single command used as the default binding
of many shifted keys can accomplish that. That same
command can also arrange to implicitly push a tentative
mark, if invoked when not already in shift-mode.
This saves keystrokes even for hard-core emacs users:
With tentative marks, the default is to discard the mark.
That's very convenient when copying to the kill ring.
Set a tentative mark at one end of what to copy. Shiftedly
navigate to the other end. Copy to the kill ring discarding
the tentative mark (or, S-M-w to copy but keep the tentative
mark). You've added to the kill ring without needing to
clear an item from your mark stack.
Finally, use S-C-space to convert a tentative mark to a
permanent one, when you want.
Implementing this requires a strange function to serve as
the default binding of relevant shifted keys, plus some
hook functions and tweaks to the mark stack to manage
"tentative marks". Not much else.
-t
- Re: Shift-movement selection, (continued)
- Re: Shift-movement selection, Stefan Monnier, 2008/03/10
- Re: Shift-movement selection, Kim F. Storm, 2008/03/10
- Re: Shift-movement selection, Stefan Monnier, 2008/03/10
- Re: Shift-movement selection, Lennart Borgman (gmail), 2008/03/10
- Re: Shift-movement selection, Richard Stallman, 2008/03/11
- Re: Shift-movement selection, Stefan Monnier, 2008/03/11
- Re: Shift-movement selection, Richard Stallman, 2008/03/11
- Re: Shift-movement selection, Kim F. Storm, 2008/03/12
- Re: Shift-movement selection, Richard Stallman, 2008/03/12
- Re: Shift-movement selection, Kim F. Storm, 2008/03/12
- Re: Shift-movement selection,
Thomas Lord <=
- Re: Shift-movement selection, Thomas Lord, 2008/03/12
- Re: Shift-movement selection, tomas, 2008/03/13
- Re: Shift-movement selection, Alan Mackenzie, 2008/03/11
- Re: Shift-movement selection, Lennart Borgman (gmail), 2008/03/11
- Re: Shift-movement selection, David Kastrup, 2008/03/11
- Re: Shift-movement selection, Lennart Borgman (gmail), 2008/03/11
- Re: Shift-movement selection, Stefan Monnier, 2008/03/11
- Re: Shift-movement selection, Richard Stallman, 2008/03/12
- Re: Shift-movement selection, Richard Stallman, 2008/03/12
- Re: Shift-movement selection, Kim F. Storm, 2008/03/12