emacs-devel
[Top][All Lists]
Advanced

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

Re: master 859190f 2/3: Convert some keymaps to defvar-keymap


From: Lars Ingebrigtsen
Subject: Re: master 859190f 2/3: Convert some keymaps to defvar-keymap
Date: Wed, 13 Oct 2021 01:23:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Kangas <stefankangas@gmail.com> writes:

>>> In the current Emacs tree, we have >7K instances of define-key with a
>>> string as a parameter, and 441 with (kbd ...).

Actually, when thinking about this a bit more, perhaps the potential for
confusion is radically lower than I first imagined.

That is,

(equal (kbd "\C-xf") (kbd "C-x f"))
=> t

So even if somebody uses "\C-xf" in `define-keymap' (and we're running
all the string values through `kbd'), then it won't actually break
anything.

If somebody's writing "C-x" to bind the three letter sequence `C - x',
they'll be surprised, but I don't think anybody has ever bound such a
sequence, so...

On the fourth hand, perhaps this "it just works anyway" thing would make
things even more confusing -- I mean, it'd "just work" no matter what
syntax you use, except in rare corner cases.

> Right, but how much of that is preloaded code, how much is unchanged
> since the 1990's, how much is written by core developers who can't use
> `kbd' due to bootstrap and just got out of the habit, etc.?

Might be a lot due to the bootstrap sitch -- if you can't use it
everywhere, then best avoid it to avoid surprises.

> From a quick glance, it looks like the meat of this is in
> `edmacro-parse-keys'.  From there, you have a ton of calls to `cl-lib',
> regexps and what have you.  But nothing in there looks like it should be
> impossible to get in shape, even for early bootstrap, does it?

No, skimming that, it's much simpler than I imagined.  Rewriting that
and plonking it into subr.el would be nice.  I mean, I think we should
do that anyway, so that we can use `kbd' everywhere.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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