diff options
author | 2011-04-02 12:41:14 +0200 | |
---|---|---|
committer | 2011-04-02 12:41:14 +0200 | |
commit | da3357de4c0cf49657fc6374213e934d3ca1b1bb (patch) | |
tree | 50e88c7253162d25d8e27fdf0c902876dce77c63 /emacs.d/10-font-lock.el | |
parent | 8a637b9d4d3a092ccdb231a7141c75924e474e85 (diff) | |
download | dotfiles-da3357de4c0cf49657fc6374213e934d3ca1b1bb.tar.gz dotfiles-da3357de4c0cf49657fc6374213e934d3ca1b1bb.zip |
Added functions and supercharged my fontlocking for C and PHP
Diffstat (limited to 'emacs.d/10-font-lock.el')
-rw-r--r-- | emacs.d/10-font-lock.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/emacs.d/10-font-lock.el b/emacs.d/10-font-lock.el index 026099d..a98566c 100644 --- a/emacs.d/10-font-lock.el +++ b/emacs.d/10-font-lock.el @@ -1,16 +1,21 @@ -(defun add-my-php-keywords (mode) +;; Currently support for [ ] | & ! . + = - / % * , ( ) < > { } ? : -> +(defun add-my-c-keywords (mode) + ;; 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 - ;; Currently support for [ ] | & ! . + = - / % * , ( ) < > { } ? : => -> - '(("\\([\\[|.!+=&/%*,(){}:-]\\|\\]\\|\\ [><]\\ \\|[^<]\\?[^>]\\|\\=>\\)" 1 font-lock-operator-face) - ("\\(;\\)" 1 font-lock-end-statement)))) + '(("\\(->\\|[\\[|.+=&/%*,{}:?<>-]\\|\\]\\)" 1 font-lock-operator-face) + ("\\(;\\)" 1 font-lock-end-statement)) 1)) -(defun add-my-c-keywords (mode) +(defun add-my-php-keywords (mode) + (add-my-c-keywords mode) (font-lock-add-keywords mode - ;; Currently support for [ ] | & ! . + = - / % * , ( ) < > { } ? : => -> - '(("\\([\\[|!+=&%*,(){}:-]\\|\\]\\|\\ [><]\\ \\|[^<]\\?[^>]\\|\\=>\\|[^<].*[./].*[^>]\\)" 1 font-lock-operator-face) - ("\\(;\\)" 1 font-lock-end-statement)))) + ;; Currently support for => + '(("\\(\\=>\\)" 1 font-lock-operator-face)))) (add-my-c-keywords 'c-mode) (add-my-php-keywords 'php-mode) |