From: Jim Porter <jporterbugs@gmail.com>
To: "Sebastián Monía" <sebastian@sebasmonia.com>
Cc: emacs-devel@gnu.org
Subject: Re: Interest in keymap-set + use-package (+ bind-key)?
Date: Thu, 14 Nov 2024 13:47:19 -0800 [thread overview]
Message-ID: <c7c31dfa-d438-137e-75a4-eadb5d81210f@gmail.com> (raw)
In-Reply-To: <thqna5e17vjo.fsf@sebasmonia.com>
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?
prev parent reply other threads:[~2024-11-14 21:47 UTC|newest]
Thread overview: 3+ 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 [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=c7c31dfa-d438-137e-75a4-eadb5d81210f@gmail.com \
--to=jporterbugs@gmail.com \
--cc=emacs-devel@gnu.org \
--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).