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
(defun +cc|fontify-constants ()
"Better fontification for preprocessor constants"
(font-lock-add-keywords
nil '(("\\<[A-Z]*_[A-Z_]+\\>" . font-lock-constant-face)
("\\<[A-Z]\\{3,\\}\\>" . font-lock-constant-face))
t))
(when (memq major-mode '(c-mode c++-mode))
(font-lock-add-keywords
nil '(("\\<[A-Z]*_[A-Z_]+\\>" . font-lock-constant-face)
("\\<[A-Z]\\{3,\\}\\>" . font-lock-constant-face))
t)))
;;;###autoload
(defun +cc|irony-init-compile-options ()