[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fontifying function calls in emacs-lisp-mode
From: |
Nordlöw |
Subject: |
Fontifying function calls in emacs-lisp-mode |
Date: |
24 Apr 2007 08:47:29 -0700 |
User-agent: |
G2/1.0 |
Hey there, Emacs Lovers!
I am trying to fontify function calls in emacs-lisp-mode and have come
up with the following code. It however replaces fontification of
keyword statements, such as defun, defface, etc, eventhough i use
"keep".
How can I avoid this?
;; Function call face
(defface font-lock-function-call-face ;function-call
'((((class color)) (:inherit font-lock-function-name-face :bold
nil)))
"Font Lock mode face used to highlight function calls.")
;; Emacs LISP Extra Font Locking
(defun pnw-emacs-lisp-mode-extra-font-locking ()
(font-lock-add-keywords
nil
(list
;; special constants nil and t
(cons (concat "\\<" "\\(" "nil" "\\|" "t" "\\)" "\\>")
'(1 'font-lock-number-literal-face keep))
;; function calls
(cons (concat "(" "[\t ]*" "\\(" "\\w+" "\\)")
'(1 'font-lock-function-call-face keep))
)))
(add-hook 'emacs-lisp-mode-hook 'pnw-emacs-lisp-mode-extra-font-
locking)
Thanks in advance,
Nordlöw
- Fontifying function calls in emacs-lisp-mode,
Nordlöw <=