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: Lars Ingebrigtsen
Subject: Re: Moving kbd to subr.el
Date: Fri, 15 Oct 2021 14:31:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Andreas Schwab <schwab@linux-m68k.org> writes:

>> That's because 'ch' can include modifier bits set,
>
> A modified character is no longer a characterp ...

Yup.

In

commit 629d4dcd2a184da6a0b246d31f152a84327db51a
Author:     Richard M. Stallman <rms@gnu.org>
AuthorDate: Tue Sep 21 03:44:04 1993 +0000

    Total rewrite by Gillespie.

+                  always (and (integerp ch)
+                              (let ((ch2 (logand ch (lognot (lsh 1 23)))))
+                                (and (>= ch2 0) (<= ch2 127))))))

which works as intended (probably), and then it became

commit ac2665815a33a8bd106741f13e06dcdd0033ea41
Author:     Dave Love <fx@gnu.org>
AuthorDate: Sun May 21 19:51:14 2000 +0000

    (edmacro-parse-keys): Return vector if any elements are invalid
    characters.

diff --git a/lisp/edmacro.el b/lisp/edmacro.el
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -712,9 +712,9 @@
     (if (and (not need-vector)
             (loop for ch across res
-                  always (and (integerp ch)
+                  always (and (char-valid-p ch)
                               (let ((ch2 (logand ch (lognot ?\M-\^@))))
                                 (and (>= ch2 0) (<= ch2 127))))))

which may or may not have worked, and then it became

commit 97443772e0967cbcfdb5e7f7a650256c7ea8b83e
Author:     Dave Love <fx@gnu.org>
AuthorDate: Wed Sep 10 17:53:50 2003 +0000


diff --git a/lisp/edmacro.el b/lisp/edmacro.el
--- a/lisp/edmacro.el
+++ b/lisp/edmacro.el
@@ -718,9 +718,9 @@
     (if (and (not need-vector)
             (loop for ch across res
-                  always (and (char-valid-p ch)
+                  always (and (characterp ch)

which also may or may not have worked as intended at the time.

But I think we should just replace it with the <= 127 test and not
change the behaviour any more at this point.  We could change it back to
the behaviour it probably used to have; i.e., (kbd "M-s") => "\M-s",
though.

-- 
(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]