Ajouts emacsrc pour coloration en mode C
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 15 Sep 2011 05:27:54 +0000 (05:27 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 15 Sep 2011 05:27:54 +0000 (05:27 +0000)
stage5/misc/emacs/emacsrc

index 9db7a0e..ba35287 100644 (file)
     (add-hook 'after-save-hook 'byte-compile-user-init-file t t)))
 (add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook)
 
+;; To highlight function calls in CC mode.
+(defface font-lock-function-call-face
+  '((t (:foreground "mediumpurple")))
+  "Font Lock mode face used to highlight function calls."
+  :group 'font-lock-highlighting-faces)
+(defvar font-lock-function-call-face 'font-lock-function-call-face)
+(add-hook 'c-mode-hook
+          (lambda ()
+            (font-lock-add-keywords
+             nil
+             '(("\\<\\(\\sw+\\) ?(" 1 font-lock-function-call-face)) t)))
+
+;; Pour colorer TRUE et FALSE
+(defconst bm-additional-constant-keywords
+  (cons
+   (regexp-opt
+       (list
+        "TRUE" "FALSE"
+        ) 'words)
+   font-lock-constant-face
+   ))
+(font-lock-add-keywords
+ 'c-mode
+ (list
+  bm-additional-constant-keywords
+  ))
+
 (custom-set-variables
   ;; custom-set-variables was added by Custom.
   ;; If you edit it by hand, you could mess it up, so be careful.