emacs-devel
[Top][All Lists]
Advanced

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

Re: ctl-x-map key binding conventions for new major/minor modes


From: Eli Zaretskii
Subject: Re: ctl-x-map key binding conventions for new major/minor modes
Date: Sat, 13 May 2017 17:33:43 +0300

> From: Kaushal Modi <address@hidden>
> Date: Sat, 13 May 2017 14:16:46 +0000
> Cc: address@hidden, address@hidden
> 
>  Perhaps instead of adding recommendations about this, we could have a
>  feature where define-key invoked as part as 'load' or 'require' would
>  check, once, if the key being rebound already has a binding, 
> 
>  and ask
>  the user what she would like to do about, with 3 possible answers
>  being "rebind", "don't rebind", and "error out of 'load'"?
> 
> Would that halt emacs startup with that prompt?

It would stop the load of the features which redefines the keys.

> If so, I believe that would cause an annoyance for a lot of
> users who might have already shadowed bindings.

That's why I proposed to do that only once, the first time this
ever happens for a key or a group of keys.

> What if define-key is instead made to throw a message or a warning?

What's the difference between a message and a warning?

Anyway, this could also be good, but its disadvantage is that it
doesn't let the user an opportunity to reject the rebinding.

> (define-key KEYMAP KEY DEF) 
> 
> If it is made into
> 
> (define-key KEYMAP KEY DEF &optional ALLOW-OVERRIDE)
> 
> - By default, the overriding will happen as now, but the above mentioned 
> warning will also be put out in
> *Messages*.
> - If ALLOW-OVERRIDE is 'prevent, the overriding will be blocked silently.
> - If ALLOW-OVERRIDE is any other non-nil value, overriding will happen and 
> that warning is not thrown. 

I think this should be an interactive feature, not a non-interactive
one.



reply via email to

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