[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ae3416d694 7/7: Simplify lisp-el-font-lock-keywords-2 definition
From: |
Stefan Kangas |
Subject: |
master ae3416d694 7/7: Simplify lisp-el-font-lock-keywords-2 definition slightly |
Date: |
Sun, 3 Jul 2022 17:35:13 -0400 (EDT) |
branch: master
commit ae3416d69431fe80e767813bfe9837df599eca98
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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 ac56d42339..d61432b7dd 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 "\\_>")
- 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, 2022/07/03
- 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 <=