From ae3416d69431fe80e767813bfe9837df599eca98 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 3 Jul 2022 23:05:50 +0200 Subject: [PATCH] Simplify lisp-el-font-lock-keywords-2 definition slightly * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Simplify slightly. --- lisp/emacs-lisp/lisp-mode.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index ac56d423391..d61432b7ddf 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -478,17 +478,15 @@ This will generate compile-time constants from BINDINGS." (2 font-lock-constant-face nil t)) ;; Words inside \\[], \\<>, \\{} or \\`' tend to be for ;; `substitute-command-keys'. - (,(rx "\\\\[" (group (regexp lisp-mode-symbol-regexp)) "]") + (,(rx "\\\\" (or (seq "[" (group-n 1 (regexp lisp-mode-symbol-regexp)) "]") + (seq "`" (group-n 1 (+ (regexp lisp-mode-symbol-regexp) + ;; allow multiple words, e.g. "C-x a" + (? " "))) + "'"))) (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" - (? " "))) - "'") - (1 font-lock-constant-face prepend)) ;; Ineffective backslashes (typically in need of doubling). ("\\(\\\\\\)\\([^\"\\]\\)" (1 (elisp--font-lock-backslash) prepend)) @@ -496,7 +494,7 @@ This will generate compile-time constants from BINDINGS." (,(concat "[`‘']\\(" lisp-mode-symbol-regexp "\\)['’]") (1 font-lock-constant-face prepend)) ;; \\= tends to be an escape in doc strings. - ("\\\\\\\\=" + (,(rx "\\\\=") (0 font-lock-builtin-face prepend)) ;; Constant values. (,(concat "\\_<:" lisp-mode-symbol-regexp "\\_>") -- 2.39.2