emacs-devel
[Top][All Lists]
Advanced

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

Re: position on changing defaults?


From: Kim F. Storm
Subject: Re: position on changing defaults?
Date: Sun, 09 Mar 2008 23:56:17 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux)

Richard Stallman <address@hidden> writes:

> Binding some set of shifted keys to a command that says "run the
> equivalent non-shifted character but do this other special thing"
> seems better, because you could override that for individual shifted
> keys if you wish.

The problem is that running something based on the key - rather
than on the command bound to that key is a bad road to take.

CUA mode looks for a 'CUA property with value 'move to detect what
keys are movements to which the shift modifier may apply.
This has the advantage that unrelated modes simply set that property
to make them "CUA aware".  

A generic solution could be to look for a non-nil 'shift property on
the command and run a shifted-key-hook prior to running the command,
i.e. something like this in the command loop just before running the
command:

          if (!NILP (Vshifted_key_hook) && key_shifted_p
             && !NILP (Vthis_command)
             && SYMBOLP (Vthis_command)
             && !NILP (Fget (Vthis_command, Qshift))
             && !NILP (Vrun_hooks))
            safe_run_hooks (Qshifted_key_hook);
            
This could be combined with the delayed deactivate-mark hack
we discussed earlier to deactivate the mark on non-shifted movement...

I can make a patch to do this...

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





reply via email to

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