emacs-devel
[Top][All Lists]
Advanced

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

Re: position on changing defaults?


From: Lennart Borgman (gmail)
Subject: Re: position on changing defaults?
Date: Sat, 08 Mar 2008 01:40:54 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Miles Bader wrote:
Richard Stallman <address@hidden> writes:
    You also need to handle the case where you have use shifted arrow
    to mark the region, and then use an unshifted arrow ... which should
    deactivate the mark.

It seems like a simpler solution would be to have special events like <shift-down> <shift-up> <meta-down> <meta-up> etc....

Why not just bind the shifted and unshifted arrow keys to new commands?
We only need 8 of them.

Actually in usual practice, this feature is used with many other
movement commands too, not just the arrow keys -- for instance, S-C-home
will highlight to the beginning of the buffer in typical MS-type apps
(so in emacs, that should work, and so should S-M-<), and S-M-right will
highlight the next word (so in emacs S-M-f should do so as well).

Emacs could just exhaustively bind the shifted versions of all common
movement commands, but of course this is a bit brittle (user rebindings
won't be automatically handled).

Maybe a much more radical surgery would be easier. How about having the convention that whenever a movement is bound to a shifted key then this should activate the region? If the movement is bound to a non-shifted key then it should deactivate the region.

Could not something like this be handled in the command loop?

Of course such a radical change would need a defcustom to remove it. And some cases would have to be exceptions.

There's also the "_non_-shifted movement should _deactivate_ the region"
issue which Kim mentioned earlier; it occurs to me that perhaps that
could be handled simply by having "shift activation" (activating the
region by using a shifted movement command) add a _temporary_
post-command hook, which would take care of deactivating the mark
appropriately, and would then remove itself from the post-command-hook
list.  While it would still be using post-command-hook, I think this
would be much better than the current cua mechanism, because it limits
the use of post-command-hook to only those periods when this feature is
actually actively in use.

[This "temporary post-command-hook" method should work with the
"modifier bindings" method (i.e., allowing bindings of modifier keys
which would match all otherwise-unbound events having those modifiers) I
suggested earlier as well.]

-Miles





reply via email to

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