lang/cc: fontify constants only in c/c++ buffers

This commit is contained in:
Henrik Lissner 2018-04-21 21:04:55 -04:00
parent a5877139cd
commit fa3f627f44
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -66,10 +66,11 @@ preceded by the opening brace or a comma (disregarding whitespace in between)."
;;;###autoload ;;;###autoload
(defun +cc|fontify-constants () (defun +cc|fontify-constants ()
"Better fontification for preprocessor constants" "Better fontification for preprocessor constants"
(font-lock-add-keywords (when (memq major-mode '(c-mode c++-mode))
nil '(("\\<[A-Z]*_[A-Z_]+\\>" . font-lock-constant-face) (font-lock-add-keywords
("\\<[A-Z]\\{3,\\}\\>" . font-lock-constant-face)) nil '(("\\<[A-Z]*_[A-Z_]+\\>" . font-lock-constant-face)
t)) ("\\<[A-Z]\\{3,\\}\\>" . font-lock-constant-face))
t)))
;;;###autoload ;;;###autoload
(defun +cc|irony-init-compile-options () (defun +cc|irony-init-compile-options ()