]> git.eshelyaron.com Git - emacs.git/commitdiff
Highlight uninterned symbols.
authorSam Steingold <sds@gnu.org>
Tue, 31 Oct 2017 19:20:51 +0000 (15:20 -0400)
committerSam Steingold <sds@gnu.org>
Tue, 31 Oct 2017 19:20:51 +0000 (15:20 -0400)
* 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).

lisp/emacs-lisp/lisp-mode.el

index fd12635d85c8628116a555abdc321be618bcbd5f..0e1d370919414dbbe9badd80a8a1530fb6b58c54 100644 (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))