From: Sam Steingold Date: Tue, 31 Oct 2017 19:20:51 +0000 (-0400) Subject: Highlight uninterned symbols. X-Git-Tag: emacs-27.0.90~6206 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bae7a63b808433073ad04ac64eff13e4b4facc01;p=emacs.git 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). --- 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))