diff options
author | Sam Steingold <sds@gnu.org> | 2017-10-31 15:20:51 -0400 |
---|---|---|
committer | Sam Steingold <sds@gnu.org> | 2017-10-31 15:20:51 -0400 |
commit | bae7a63b808433073ad04ac64eff13e4b4facc01 (patch) | |
tree | a3f73fcb828375b7a4fe29b5ee355a083eadf8da /lisp/emacs-lisp/lisp-mode.el | |
parent | e85586abd1912c8e47422a820097cd2ffd85ad8b (diff) | |
download | emacs-bae7a63b808433073ad04ac64eff13e4b4facc01.tar.gz |
Highlight uninterned symbols.
* lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2):
Highlight uninterned symbols, often used as string designators to
avoid namespace pollution (https://stackoverflow.com/a/46981940/850781).
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index fd12635d85c..0e1d3709194 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -491,6 +491,11 @@ This will generate compile-time constants from BINDINGS." (,(concat "[`‘]\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)" lisp-mode-symbol-regexp "\\)['’]") (1 font-lock-constant-face prepend)) + ;; Uninterned symbols, e.g., (defpackage #:my-package ...) + ;; must come before keywords below to have effect + (,(concat "\\(#:\\)\\(" lisp-mode-symbol-regexp "\\)") + (1 font-lock-comment-delimiter-face) + (2 font-lock-doc-face)) ;; Constant values. (,(concat "\\_<:" lisp-mode-symbol-regexp "\\_>") (0 font-lock-builtin-face)) |