Function: font-latex-keyword-matcher

font-latex-keyword-matcher is a function defined in font-latex.el.

Signature

(font-latex-keyword-matcher PREFIX NAME FACE TYPE)

Documentation

Return a matcher and highlighter as required by font-lock-keywords.

PREFIX and NAME are strings which are concatenated to form the respective match function. FACE is a face name or a list of face attributes that will be applied to the respective part of the match returned by the match function. A lisp form returning a face name or a list of face attributes is also valid for FACE. TYPE is the type of construct to be highlighted. Currently the symbols command, declaration and noarg are valid.

This is a helper function for font-latex-make-built-in-keywords and font-latex-make-user-keywords and not intended for general use.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/font-latex.el
(defun font-latex-keyword-matcher (prefix name face type)
  "Return a matcher and highlighter as required by `font-lock-keywords'.
PREFIX and NAME are strings which are concatenated to form the
respective match function.  FACE is a face name or a list of face
attributes that will be applied to the respective part of the
match returned by the match function.  A lisp form returning a
face name or a list of face attributes is also valid for FACE.
TYPE is the type of construct to be highlighted.  Currently the
symbols `command', `declaration' and `noarg' are valid.

This is a helper function for `font-latex-make-built-in-keywords'
and `font-latex-make-user-keywords' and not intended for general
use."
  ;; Quote a list of face attributes and a face symbol
  ;; but do not quote a form returning such value.
  (unless (and (listp face) (fboundp (car face)))
    (setq face `',face))

  ;; In an earlier version of font-latex the type could be a list like
  ;; (command 1).  This indicated a macro with one argument.  Provide
  ;; a matcher in this case but don't actually support it.
  (cond ((or (eq type 'command) (listp type))
         `(,(intern (concat prefix name))
           (0 (font-latex-matched-face 0) append t)
           (1 (font-latex-matched-face 1) append t)
           (2 (font-latex-matched-face 2) append t)
           (3 (font-latex-matched-face 3) append t)
           (4 (font-latex-matched-face 4) append t)
           (5 (font-latex-matched-face 5) append t)
           (6 (font-latex-matched-face 6) append t)
           (7 (font-latex-matched-face 7) append t)
           (8 (font-latex-matched-face 8) append t)
           (9 (font-latex-matched-face 9) append t)
           (10 (font-latex-matched-face 10) append t)
           (11 (font-latex-matched-face 11) append t)))
        ((eq type 'noarg)
         `(,(intern (concat prefix name))
           (0 ,face)))
        ((eq type 'declaration)
         `(,(intern (concat prefix name))
           (0 'font-latex-warning-face t t)
           (1 'font-lock-keyword-face append t)
           (2 ,face append t)))))