Function: generic-make-keywords-list

generic-make-keywords-list is an autoloaded and byte-compiled function defined in generic.el.gz.

This function is obsolete since 24.4; use regexp-opt instead.

Signature

(generic-make-keywords-list KEYWORD-LIST FACE &optional PREFIX SUFFIX)

Documentation

Return a font-lock-keywords construct that highlights KEYWORD-LIST.

KEYWORD-LIST is a list of keyword strings that should be highlighted with face FACE. This function calculates a regular expression that matches these keywords and concatenates it with PREFIX and SUFFIX. Then it returns a construct based on this regular expression that can be used as an element of font-lock-keywords.

Probably introduced at or before Emacs version 24.4.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/generic.el.gz
;;;###autoload
(defun generic-make-keywords-list (keyword-list face &optional prefix suffix)
  "Return a `font-lock-keywords' construct that highlights KEYWORD-LIST.
KEYWORD-LIST is a list of keyword strings that should be
highlighted with face FACE.  This function calculates a regular
expression that matches these keywords and concatenates it with
PREFIX and SUFFIX.  Then it returns a construct based on this
regular expression that can be used as an element of
`font-lock-keywords'."
  (declare (obsolete regexp-opt "24.4"))
  (unless (listp keyword-list)
    (error "Keywords argument must be a list of strings"))
  (list (concat prefix "\\_<"
		;; Use an optimized regexp.
		(regexp-opt keyword-list t)
		"\\_>" suffix)
	1
	face))