emacs-devel
[Top][All Lists]
Advanced

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

Re: Interest in keymap-set + use-package (+ bind-key)?


From: Jim Porter
Subject: Re: Interest in keymap-set + use-package (+ bind-key)?
Date: Thu, 14 Nov 2024 13:47:19 -0800

On 11/14/2024 6:13 AM, Sebastián Monía wrote:
Wouldn't it make sense to have bind-key use that syntax going forward,
though? Maybe it can't be done without breaking existing code, and
that's why we would need a new keyword?

If we can do that in a way that doesn't break existing calls, I think that would be ok. Maybe we could replace the calls to 'define-key' with something like...

  (if (key-valid-p KEY)
      (keymap-set KEYMAP KEY DEFN)
    (lwarn 'bind-key :warning "Legacy key value detected!")
    (define-key KEYMAP KEY DEFN))

That way, if KEY is valid according to the new keymap.el standards, we prefer 'keymap-set'. Otherwise, fall back to the old way and emit a warning so the user can fix their config. Then, sometime a few years from now, we could remove the 'define-key' fallback?



reply via email to

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