unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: Fontifying function calls in emacs-lisp-mode
@ 2007-04-25  6:36 martin rudalics
  0 siblings, 0 replies; 6+ messages in thread
From: martin rudalics @ 2007-04-25  6:36 UTC (permalink / raw)
  To: per.nordlow; +Cc: help-gnu-emacs

(defun pnw-emacs-lisp-mode-extra-font-locking ()
   (font-lock-add-keywords
    nil
    (list
     ...
    t)) ; Try to assign the third argument HOW here to anything but 'set

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Fontifying function calls in emacs-lisp-mode
@ 2007-04-24 15:47 Nordlöw
  2007-04-24 16:46 ` Peter Tury
  0 siblings, 1 reply; 6+ messages in thread
From: Nordlöw @ 2007-04-24 15:47 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-04  9:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2492.1177484258.7795.help-gnu-emacs@gnu.org>
2007-04-26  9:21 ` Fontifying function calls in emacs-lisp-mode Nordlöw
2007-07-03 13:12   ` rjp
     [not found]   ` <mailman.3007.1183472059.32220.help-gnu-emacs@gnu.org>
2007-07-04  9:10     ` Tim X
2007-04-25  6:36 martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2007-04-24 15:47 Nordlöw
2007-04-24 16:46 ` Peter Tury

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).