]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/lread.c (read_escape): Fix handling of ?\C-<char> for chars 128-255
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 14 Nov 2021 17:56:11 +0000 (12:56 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 14 Nov 2021 17:56:11 +0000 (12:56 -0500)
src/lread.c
test/src/lread-tests.el

index 3052bcbd063aa9a1e01813b12604675a72270b11..2e63ec489127e518c849c342338ac1149427cf9b 100644 (file)
@@ -2709,7 +2709,7 @@ read_escape (Lisp_Object readcharfun, bool stringp)
        c = read_escape (readcharfun, 0);
       if ((c & ~CHAR_MODIFIER_MASK) == '?')
        return 0177 | (c & CHAR_MODIFIER_MASK);
-      else if (! SINGLE_BYTE_CHAR_P ((c & ~CHAR_MODIFIER_MASK)))
+      else if (! ASCII_CHAR_P ((c & ~CHAR_MODIFIER_MASK)))
        return c | ctrl_modifier;
       /* ASCII control chars are made from letters (both cases),
         as well as the non-letters within 0100...0137.  */
index be685fe999f200c14eb18f6dbe6304e63c564134..c635c592b285c327fc4e007dbd82fc171573c8c8 100644 (file)
   (should-error (read "#24r") :type 'invalid-read-syntax)
   (should-error (read "#") :type 'invalid-read-syntax))
 
+(ert-deftest lread-char-modifiers ()
+  (should (eq ?\C-\M-é (+ (- ?\M-a ?a) ?\C-é)))
+  (should (eq (- ?\C-ŗ ?ŗ) (- ?\C-é ?é))))
+
 (ert-deftest lread-record-1 ()
   (should (equal '(#s(foo) #s(foo))
                  (read "(#1=#s(foo) #1#)"))))