emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3b66c23325: Font lock \\`' command substitutions in docstrings


From: Stefan Kangas
Subject: master 3b66c23325: Font lock \\`' command substitutions in docstrings
Date: Fri, 1 Jul 2022 23:58:21 -0400 (EDT)

branch: master
commit 3b66c23325909fef077831c5f289221583e75bd7
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Font lock \\`' command substitutions in docstrings
    
    * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
    Support \\`' command substitutions.
---
 lisp/emacs-lisp/lisp-mode.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 6d5391d1e9..3797217e1a 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -476,8 +476,14 @@ 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 \\[] tend to be for `substitute-command-keys'.
-         (,(concat "\\\\\\\\\\[\\(" lisp-mode-symbol-regexp "\\)\\]")
+         ;; Words inside \\[] or \\`' tend to be for `substitute-command-keys'.
+         (,(rx "\\\\[" (group (regexp lisp-mode-symbol-regexp)) "]")
+          (1 font-lock-constant-face prepend))
+         (,(rx "\\\\`" (group
+                        (+ (regexp lisp-mode-symbol-regexp)
+                           ;; allow multiple words, e.g. "C-x a"
+                           (? " ")))
+               "'")
           (1 font-lock-constant-face prepend))
          ;; Ineffective backslashes (typically in need of doubling).
          ("\\(\\\\\\)\\([^\"\\]\\)"



reply via email to

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