legacy-dotfiles/emacs.d/10-font-lock.el

31 lines
1 KiB
EmacsLisp
Raw Normal View History

;; Currently support for [ ] | & ! . + = - / % * , ( ) < > { } ? : ->
(defun add-my-c-keywords (mode append)
;; Add ! at the beginning of font lock
(font-lock-add-keywords
mode
'(("\\([!()]\\)" 1 font-lock-operator-face)))
;; Add the rest at the end of font lock
(font-lock-add-keywords
mode
'(("\\(->\\|[\\[|.+=&/%*,{}:?<>-]\\|\\]\\)" 1 font-lock-operator-face)
("\\(;\\)" 1 font-lock-end-statement)) append))
(defun add-my-php-keywords (mode)
(add-my-c-keywords mode 1)
(font-lock-add-keywords
mode
;; Currently support for =>
'(("\\(\\=>\\)" 1 font-lock-operator-face))))
2011-04-17 02:02:18 +02:00
;(add-my-c-keywords 'c-mode 1)
;(add-my-php-keywords 'php-mode)
;(add-my-c-keywords 'javascript-mode nil)
2011-04-17 02:02:18 +02:00
;(make-face 'font-lock-operator-face)
;(make-face 'font-lock-end-statement)
;(defvar font-lock-operator-face 'font-lock-operator-face)
;(defvar font-lock-end-statement 'font-lock-end-statement)
2011-04-17 02:02:18 +02:00
;(set-face-foreground 'font-lock-operator-face "#EDD400")
;(set-face-foreground 'font-lock-end-statement "#888A85")