From: Stefan Kangas <stefankangas@gmail.com>
To: "Jim Porter" <jporterbugs@gmail.com>,
"Sebastián Monía" <sebastian@sebasmonia.com>
Cc: emacs-devel@gnu.org
Subject: Re: Interest in keymap-set + use-package (+ bind-key)?
Date: Thu, 2 Jan 2025 11:00:58 -0600 [thread overview]
Message-ID: <CADwFkm=YvDqhkQ8tMN2VEtVoR_FvKLt2_r0jcWZGY7SUSjPxZg@mail.gmail.com> (raw)
In-Reply-To: <c7c31dfa-d438-137e-75a4-eadb5d81210f@gmail.com>
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.
prev parent reply other threads:[~2025-01-02 17:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 3:03 Interest in keymap-set + use-package (+ bind-key)? Jim Porter
2024-11-14 14:13 ` Sebastián Monía
2024-11-14 21:47 ` Jim Porter
2025-01-02 17:00 ` Stefan Kangas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADwFkm=YvDqhkQ8tMN2VEtVoR_FvKLt2_r0jcWZGY7SUSjPxZg@mail.gmail.com' \
--to=stefankangas@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jporterbugs@gmail.com \
--cc=sebastian@sebasmonia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).