emacs-devel
[Top][All Lists]
Advanced

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

Re: Shift-movement selection


From: Alan Mackenzie
Subject: Re: Shift-movement selection
Date: Tue, 11 Mar 2008 22:42:32 +0000
User-agent: Mutt/1.5.9i

Hi, Kim!

On Mon, Mar 10, 2008 at 04:06:54PM +0100, Kim F. Storm wrote:
> Stefan Monnier <address@hidden> writes:

> >>>> So to make it work "correctly", you need to modify all commands in
> >>>> emacs!  [yikes!]
> >>> Most commands already deactivate the mark.  So which ones would be left?

> >> Anything that doesn't modify the buffer -- e.g. all movement commands.

> > Supposedly these will be changed to use the new function, so they will
> > explicitly deactivate the mark if the mark was activated with shift and
> > the movement is then performed without the shift.


> One problem is that basic movement commands are in C, not in Lisp.

Why not introduce an after-move-hook, somewhat akin to after-change-hook?
Possibly as a normal hook, possibly one where each function takes a
single parameter, the old value of point.  

> Another problem may be advise on functions - the "shift" handling
> may then be performed too late.

> Personally, I like my proposal of just setting a "shift" property
> on the relevant commands, and do it by running a shifted-key-hook
> in the command loop.  

Assuming Emacs knows whether the shift key is currently depressed (it
does, doesn't it, by looking at the key sequence?) the after-move-hook
could be ideal place to deal with "shift"-movement actions.

> That method has proven to work excellent with CUA mode!

> For one thing, it is trivial for a user to add shift-region support
> for new movement commands in an external package - without modifying
> the code of that package.

> -- 
> Kim F. Storm <address@hidden> http://www.cua.dk

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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