[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b000bd47a6 2/7: Font lock \\<> and \\{} command substitutions in
From: |
Stefan Kangas |
Subject: |
master b000bd47a6 2/7: Font lock \\<> and \\{} command substitutions in docstrings |
Date: |
Sun, 3 Jul 2022 17:35:12 -0400 (EDT) |
branch: master
commit b000bd47a6efbd12cab6e6a1b19a59014931abd8
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Font lock \\<> and \\{} command substitutions in docstrings
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
Support \\<> and \\{} command substitutions.
---
lisp/emacs-lisp/lisp-mode.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 3797217e1a..ac56d42339 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"
- master updated (e3f8dd9023 -> ae3416d694), Stefan Kangas, 2022/07/03
- master 8bb770234d 1/7: Fix warning in last commit, Stefan Kangas, 2022/07/03
- master 05297e40c0 6/7: Quote some literal keys to get help-key-binding face, Stefan Kangas, 2022/07/03
- master b000bd47a6 2/7: Font lock \\<> and \\{} command substitutions in docstrings,
Stefan Kangas <=
- master e688176b21 3/7: Use substitute-command-keys in reftex-toc-show-help, Stefan Kangas, 2022/07/03
- master 5cb8303f6b 4/7: Normalize definition of erc-track-minor-mode-map, Stefan Kangas, 2022/07/03
- master bda6e9a226 5/7: Use command substitutions instead of literal keys in some places, Stefan Kangas, 2022/07/03
- master ae3416d694 7/7: Simplify lisp-el-font-lock-keywords-2 definition slightly, Stefan Kangas, 2022/07/03