help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fontifying function calls in emacs-lisp-mode


From: Peter Tury
Subject: Re: Fontifying function calls in emacs-lisp-mode
Date: Tue, 24 Apr 2007 16:46:00 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (windows-nt)

Nordlöw <per.nordlow@gmail.com> writes:

> 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".

I think defun, defface, etc. are just the same kind of function calls
what you want to fontify. Indeed they are implemented in the same way
in .el files as your own functions...

Have you played with `prepend'?

Maybe your fontification is interpreted first, so "default" settings
will appear only if they are defined as override=t -- what is not
probable.

Maybe you should protect those "keywords" by more precise regexps??

> (defun pnw-emacs-lisp-mode-extra-font-locking ()
>   (font-lock-add-keywords
>    nil
>    (list
>     ;; special constants nil and t
>     (cons (concat "\\<" "\\(" "nil" "\\|" "t" "\\)" "\\>")

      (cons "\\<\\(nil\\|t\\)\\>"

>         '(1 'font-lock-number-literal-face keep))
>     ;; function calls
>     (cons (concat "(" "[\t ]*" "\\(" "\\w+" "\\)")

      (cons "([\t ]*\\(defun\\|defface\\|etc\\)\\(\\w+\\)" and fontify
      only 2nd group??

\bye
P


reply via email to

[Prev in Thread] Current Thread [Next in Thread]