emacs-devel
[Top][All Lists]
Advanced

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

Re: Moving kbd to subr.el


From: Stefan Kangas
Subject: Re: Moving kbd to subr.el
Date: Wed, 13 Oct 2021 15:28:36 -0700

Stefan Kangas <stefankangas@gmail.com> writes:

> I've attached a quick proof-of-concept of moving the kbd implementation
> to subr.el.  With this, all the tests I have assembled so far pass and
> this bootstraps.  It was mostly just a case of ripping out the calls to
> cl-lib functions.

Here's an updated version of this, that bootstraps like before.  Besides
studying the code more closely to convince myself that it's doing the
same thing as before, I've also pushed a more complete test suite for
'kbd' and 'edmacro-parse-keys' to master.  Thanks to everyone who
commented on the first version of this patch and helped with the tests.

This patch (hopefully) brings no functional changes, and so should not
really need any update of any documentation, unless it was in some way
already lacking before.  The only difference here should be that we can
now use `kbd' in preloaded code.

---

There is one snag in the way this has always worked: 'kbd' currently
supports everything that 'edmacro-parse-keys' does, including this part:

     * Double angle brackets enclose command names:  <<next-line>> is
       shorthand for M-x next-line RET.

     * Finally, REM or ;; causes the rest of the line to be ignored as a
       comment.

    Any word may be prefixed by a multiplier in the form of a decimal
    number and ‘*’:  3*<right> = <right> <right> <right>, and
    10*foo = foofoofoofoofoofoofoofoofoofoo.

This does not seem to make sense when it comes to using `kbd' for
keybindings.

However, I guess this has not been a problem over the years, and should
better be left alone: maybe some users are relying on it at this point.
I mostly just wanted to bring it to everyone's attention.

Attachment: 0001-Make-kbd-usable-during-bootstrap.patch
Description: Text Data

Attachment: 0002-Remove-duplicate-code-in-edmacro-parse-keys.patch
Description: Text Data


reply via email to

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