[Top][All Lists]

[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: Kaushal Modi
Subject: Re: ctl-x-map key binding conventions for new major/minor modes
Date: Sat, 13 May 2017 14:16:46 +0000

On Sat, May 13, 2017 at 3:11 AM Eli Zaretskii <address@hidden> wrote:
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? If so, I believe that would cause an annoyance for a lot of users who might have already shadowed bindings.

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

In addition, current signature of define-key is:

    (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. 

Kaushal Modi

reply via email to

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