Function: hi-lock-face-buffer
hi-lock-face-buffer is an autoloaded, interactive and byte-compiled
function defined in hi-lock.el.gz.
Signature
(hi-lock-face-buffer REGEXP &optional FACE SUBEXP LIGHTER)
Documentation
Set face of each match of REGEXP to FACE.
Interactively, prompt for REGEXP using hi-lock-read-regexp, then FACE.
Use the global history list for FACE. Limit face setting to the
corresponding SUBEXP (interactively, the prefix argument) of REGEXP.
If SUBEXP is omitted or nil, the entire REGEXP is highlighted.
LIGHTER is a human-readable string that can be used to select a regexp to unhighlight by its name instead of selecting a possibly complex regexp or closure.
If REGEXP contains upper case characters (excluding those preceded by \)
and search-upper-case is non-nil, the matching is case-sensitive.
Use Font lock mode, if enabled, to highlight REGEXP. Otherwise,
use overlays for highlighting. If overlays are used, the
highlighting will not update as you type. The Font Lock mode
is considered "enabled" in a buffer if its major-mode
causes font-lock-specified-p to return non-nil, which means
the major mode specifies support for Font Lock.
Probably introduced at or before Emacs version 23.1.
Key Bindings
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/hi-lock.el.gz
;;;###autoload
(defun hi-lock-face-buffer (regexp &optional face subexp lighter)
"Set face of each match of REGEXP to FACE.
Interactively, prompt for REGEXP using `hi-lock-read-regexp', then FACE.
Use the global history list for FACE. Limit face setting to the
corresponding SUBEXP (interactively, the prefix argument) of REGEXP.
If SUBEXP is omitted or nil, the entire REGEXP is highlighted.
LIGHTER is a human-readable string that can be used to select
a regexp to unhighlight by its name instead of selecting a possibly
complex regexp or closure.
If REGEXP contains upper case characters (excluding those preceded by `\\')
and `search-upper-case' is non-nil, the matching is case-sensitive.
Use Font lock mode, if enabled, to highlight REGEXP. Otherwise,
use overlays for highlighting. If overlays are used, the
highlighting will not update as you type. The Font Lock mode
is considered \"enabled\" in a buffer if its `major-mode'
causes `font-lock-specified-p' to return non-nil, which means
the major mode specifies support for Font Lock."
(interactive
(list
(hi-lock-read-regexp "Regexp to highlight")
(hi-lock-read-face-name)
current-prefix-arg))
(when (stringp face)
(setq face (intern face)))
(or (facep face) (setq face 'hi-yellow))
(unless hi-lock-mode (hi-lock-mode 1))
(hi-lock-set-pattern
regexp face subexp lighter
(if (and case-fold-search search-upper-case)
(isearch-no-upper-case-p regexp t)
case-fold-search)
search-spaces-regexp))