[Top][All Lists]

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

Re: Enhancements to "minor-mode-map-alist" functionality.

From: Kim F. Storm
Subject: Re: Enhancements to "minor-mode-map-alist" functionality.
Date: 21 Apr 2002 13:08:36 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Richard Stallman <address@hidden> writes:

>     The actual interpretation of C-x is done via three of cua's 7 keymaps.
> Using separate keymaps for C-x seems reasonable.
> I wonder, though, why simply putting all three in minor-mode-map-alist
> won't do the job.  As I recall, if any active keymap defines a binding
> with a non-prefix definition, that should override all prefix
> definitions regardless of the precedence order of the maps.  Is that
> not true now?  If not, maybe we could make it true again. 

I wasn't aware of this functionality.  I'll see if it is true now.

> So there is
> no need to worry about the relative order of your maps and all other
> maps.

There are other cases where the ordering of those maps matters, but I
might be able to further limit the dependence on the ordering (by
making sure only one condition is true at a time), but I would still
prefer if I could just rely on having my own (separate)
cua-minor-mode-map-alist (on the emulation-mode-map-alists list), and
be sure that noone would mess with it.  And since I've already implemented
it, I know the change to add emulation-mode-map-alists is trivial!

> If you need to condition some of these maps on some symbol's being
> false, then we could make the minimal extension so far proposed, which
> is to allow minor-mode-map-alist (or another new alist) to have
> conditions which are more complex than just a symbol.  But you do see
> if you can easily get away without that.

If we don't allow some form of simple logical expression [e.g. the
functions I listed in a previous mail], I really don't see any
alternative to the present code cua (and viper) which refreshes a list
of state variables and fixes any ordering problems in
minor-mode-map-alist after each command.

>     To facilitate this, three more keymaps are used which selectively does
>     command remapping of `kill-ring-save' to handle either region, rectangle,
>     or the global mark.
> It would be cleaner to define a single new command for that purpose.

I don't agree.  There are many other commands which are specific for
the region, rectangle, and global mark cases, and handling those in
separate functions is a lot clearer (to me).

Actually, the new cua package consists of three files now: 
        cua-base.el  (for the basic functionality and region handling)
        cua-rect.el  (for rectangle commands)
        cua-gmrk.el  (for the global mark functionality)

>     The final keymap is used to allow users to take advantage of cua's
>     uniform command set for rectangles (and the global mark), but still
>     continue to use C-w, M-w and C-y instead of C-x, C-c, and C-v (which
>     are the normal cua bindings).
> Which characters does this map redefine?

C-z -> undo, C-v -> yank

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

reply via email to

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