]> git.eshelyaron.com Git - emacs.git/commitdiff
Font lock \\<> and \\{} command substitutions in docstrings
authorStefan Kangas <stefan@marxist.se>
Sun, 3 Jul 2022 18:59:00 +0000 (20:59 +0200)
committerStefan Kangas <stefan@marxist.se>
Sun, 3 Jul 2022 21:31:31 +0000 (23:31 +0200)
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
Support \\<> and \\{} command substitutions.

lisp/emacs-lisp/lisp-mode.el

index 3797217e1a0078609883b76b456785c7b869fa49..ac56d423391e0b0a0ff6908f4da7e00354ad5cbf 100644 (file)
@@ -476,9 +476,13 @@ This will generate compile-time constants from BINDINGS."
                    "[ \t']*\\(" lisp-mode-symbol-regexp "\\)?")
            (1 font-lock-keyword-face)
            (2 font-lock-constant-face nil t))
-         ;; Words inside \\[] or \\`' tend to be for `substitute-command-keys'.
+         ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for
+         ;; `substitute-command-keys'.
          (,(rx "\\\\[" (group (regexp lisp-mode-symbol-regexp)) "]")
           (1 font-lock-constant-face prepend))
+         (,(rx "\\\\" (or (seq "<" (group-n 1 (regexp lisp-mode-symbol-regexp)) ">")
+                          (seq "{" (group-n 1 (regexp lisp-mode-symbol-regexp)) "}")))
+          (1 font-lock-variable-name-face prepend))
          (,(rx "\\\\`" (group
                         (+ (regexp lisp-mode-symbol-regexp)
                            ;; allow multiple words, e.g. "C-x a"