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: Stefan Kangas
Subject: Re: Interest in keymap-set + use-package (+ bind-key)?
Date: Thu, 2 Jan 2025 11:00:58 -0600

Jim Porter <jporterbugs@gmail.com> writes:

> 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?

(Sorry for the late reply here...)

FWIW, your plan sounds good to me.



reply via email to

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