emacs-diffs
[Top][All Lists]
Advanced

[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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]