[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
face font in c-mode when adding new keyword
From: |
Rami A |
Subject: |
face font in c-mode when adding new keyword |
Date: |
Wed, 31 Jul 2013 12:10:06 -0700 (PDT) |
User-agent: |
G2/1.0 |
Hi,
I am trying to customize some added words to be colored differently from the
default face-font colors.
This is what I am doing:
(defconst lconfig-font-lock-faces
(list
'(font-lock-function-name-face
((((class color)) (:foreground "DarkBlue" :bold t))))
'(font-lock-constant-face
((((class color)) (:foreground "Black" :bold t))))
'(font-lock-builtin-face
((((class color)) (:foreground nil))))
'(font-lock-preprocessor-face
((((class color)) (:foreground nil))))
)
)
(autoload 'custom-set-faces "font-lock" "Set the color scheme" t)
(autoload 'font-lock-fontify-buffer "font-lock" "Fontify Buffer" t)
(progn (apply 'custom-set-faces lconfig-font-lock-faces)
(add-hook 'c-mode-common-hook 'font-lock-fontify-buffer)
(add-hook 'emacs-lisp-mode-hook 'font-lock-fontify-buffer)
)
(global-font-lock-mode t)
(font-lock-add-keywords
'c-mode
'(
("^#[ \t]*\\(ifdef\\|else\\|ifndef\\|if
!?defined\\|if\\|elif\\|endif\\|ident\\).*$" 1 font-lock-constant-face)
;#defines
("\\(^#[ \t]*define\\|^#[ \t]*include\\|^#[ \t]*undef\\).*$" 1
font-lock-function-name-face) ;other #s
)
)
unfortunately when opening a c file I see #include and #define being black
colored. Although they should match the regular expressions and turn to dark
blue.
Also #ifdef and #endif is in light dark color and not bold.
Any help is appreciated.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- face font in c-mode when adding new keyword,
Rami A <=