summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-03 20:59:00 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-03 23:31:31 +0200
commitb000bd47a6efbd12cab6e6a1b19a59014931abd8 (patch)
tree09e861a098b80ec81a76ebceb4a05a1dafb7d2ca /lisp/emacs-lisp/lisp-mode.el
parent8bb770234db78c86e633c58e130ff7a977bf4607 (diff)
downloademacs-b000bd47a6efbd12cab6e6a1b19a59014931abd8.tar.gz
Font lock \\<> and \\{} command substitutions in docstrings
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Support \\<> and \\{} command substitutions.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r--lisp/emacs-lisp/lisp-mode.el6
1 files changed, 5 insertions, 1 deletions
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"