emacs-devel
[Top][All Lists]
Advanced

[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: 16 Apr 2002 01:55:20 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Richard Stallman <address@hidden> writes:

>     > I am surprised that the present facilities can't be used more easily.
>     > Could you explain WHY you think this is necessary?  Perhaps there
>     > is already a better way.
> 
>     I'm pretty confiden that there isn't a _better_ way already.
> 
> Would you please explain to me why not?
> Before I agree that we need a new feature,
> I want to make sure we have not overlooked an
> existing good solution.  Please show the reasons
> why (you believe) these 7 keymaps are the only way.

They are not the only way!

In the CUA mode I've been promoting for the last few years I use
(only) three keymaps, a pretty complicated pre-command-hook to select
the proper keymap (to emulate the equivalent to the new command
remapping feature!), and a very ugly/messy piece of code bound to C-c
and C-x in the key-translation-map.

In addition, most functions are pretty overloaded with conditionals
to select the "proper action" for the current state.

With the new code I've written to use the new command remapping, and
the 7 keymaps, the code is _much_ simpler, as all the conditional code
is now moved out of the functions and centralized around selecting the
proper keymaps based on the current state.

I know for sure that using 7 keymaps is a vast improvement to the
old code which has been increasingly complex to maintain, so I definitely
didn't want to include that code with the emacs base.

> 
>     E.g. for cua, I need to ensure that those 7 keymaps are in the front
>     of minor-mode-map-alist after every command,
> 
> The first question is why you need 7 keymaps at all.  Why isn't one
> enough?  Why can't one key binding for a given key sequence handle all
> the various different circumstances, through conditionals in the code?

I did that to some extent in the old version of CUA.  I don't want
to repeat that mistake (in this context), as it contributed significantly
to the complexity of the old code.

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




reply via email to

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