From: Stefan Kangas Date: Sun, 3 Jul 2022 18:59:00 +0000 (+0200) Subject: Font lock \\<> and \\{} command substitutions in docstrings X-Git-Tag: emacs-29.0.90~1447^2~1225 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b000bd47a6efbd12cab6e6a1b19a59014931abd8;p=emacs.git Font lock \\<> and \\{} command substitutions in docstrings * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Support \\<> and \\{} command substitutions. --- diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 3797217e1a0..ac56d423391 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -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"