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).
This commit is contained in:
Sam Steingold 2017-10-31 15:20:51 -04:00
parent e85586abd1
commit bae7a63b80

View file

@ -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))