Here are the Original Post.
Just add the below code snippet to your ~/.emacs:
(defun my-cpp-highlight () "highlight c/c++ #if 0 #endif macros" ;; (interactive) (setq cpp-known-face 'default) (setq cpp-unknown-face 'default) (setq cpp-known-writable 't) (setq cpp-unknown-writable 't) (setq cpp-edit-list '(("0" font-lock-comment-face default both) ("1" default font-lock-comment-face both))) (cpp-highlight-buffer t)) (add-hook 'c-mode-common-hook 'my-cpp-highlight)
And your emacs will highlight the #if 0 ... #endif block for you.:)
No comments:
Post a Comment