]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix font-lock in 'lisp-mode'
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Nov 2024 14:21:36 +0000 (16:21 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 20 Nov 2024 16:15:24 +0000 (17:15 +0100)
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Fix regexps for
"\\<>" and similar constructs.  (Bug#74307)

(cherry picked from commit 200c877cd48aa0f7638fdd5157555374f0f7bfc8)

lisp/emacs-lisp/lisp-mode.el

index 876c0f803bfa0e62fb9e19c19e8701ea35281b3d..e49c8d3aa635d2ea09df21dc8ecdd9d4060861ef 100644 (file)
@@ -487,14 +487,17 @@ This will generate compile-time constants from BINDINGS."
            (2 font-lock-constant-face nil t))
          ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for
          ;; `substitute-command-keys'.
-         (,(rx "\\\\" (or (seq "[" (group-n 1 lisp-mode-symbol) "]")
+         (,(rx "\\\\" (or (seq "["
+                               (group-n 1 lisp-mode-symbol) (not "\\") "]")
                           (seq "`" (group-n 1
                                      ;; allow multiple words, e.g. "C-x a"
                                      lisp-mode-symbol (* " " lisp-mode-symbol))
                                "'")))
           (1 font-lock-constant-face prepend))
-         (,(rx "\\\\" (or (seq "<" (group-n 1 lisp-mode-symbol) ">")
-                          (seq "{" (group-n 1 lisp-mode-symbol) "}")))
+         (,(rx "\\\\" (or (seq "<"
+                               (group-n 1 lisp-mode-symbol) (not "\\") ">")
+                          (seq "{"
+                               (group-n 1 lisp-mode-symbol) (not "\\") "}")))
           (1 font-lock-variable-name-face prepend))
          ;; Ineffective backslashes (typically in need of doubling).
          ("\\(\\\\\\)\\([^\"\\]\\)"