emacs-devel
[Top][All Lists]
Advanced

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

Re: Face specifications in font-lock-keywords (part II).


From: Stefan Monnier
Subject: Re: Face specifications in font-lock-keywords (part II).
Date: Thu, 07 Apr 2005 11:32:41 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> Does that mean that Font Lock erroneously strips the quote in the
> first case?

Looks like it.  And looks like it's done on purpose, although I don't know
what this purpose is:

(defun font-lock-compile-keyword (keyword)
  (cond ((nlistp keyword)                       ; MATCHER
         (list keyword '(0 font-lock-keyword-face)))
        ((eq (car keyword) 'eval)               ; (eval . FORM)
         (font-lock-compile-keyword (eval (cdr keyword))))
        ((eq (car-safe (cdr keyword)) 'quote)   ; (MATCHER . 'FORM)
         ;; If FORM is a FACENAME then quote it.  Otherwise ignore the quote.
         (if (symbolp (nth 2 keyword))
             (list (car keyword) (list 0 (cdr keyword)))
           (font-lock-compile-keyword (cons (car keyword) (nth 2 keyword)))))
        ((numberp (cdr keyword))                ; (MATCHER . MATCH)
         (list (car keyword) (list (cdr keyword) 'font-lock-keyword-face)))
        ((symbolp (cdr keyword))                ; (MATCHER . FACENAME)
         (list (car keyword) (list 0 (cdr keyword))))
        ((nlistp (nth 1 keyword))               ; (MATCHER . HIGHLIGHT)
         (list (car keyword) (cdr keyword)))
        (t                                      ; (MATCHER HIGHLIGHT ...)
         keyword)))


-- Stefan



reply via email to

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