Function: highlight-phrase

highlight-phrase is a function alias and interactive for hi-lock-face-phrase-buffer, defined in hi-lock.el.gz.

Signature

(highlight-phrase REGEXP &optional FACE)

Documentation

Set face of each match of phrase REGEXP to FACE.

Interactively, prompt for REGEXP using hi-lock-read-regexp, then FACE. Use the global history list for FACE.

If REGEXP contains upper case characters (excluding those preceded by \) and search-upper-case is non-nil, the matching is case-sensitive. Also set search-spaces-regexp to the value of search-whitespace-regexp.

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.

View in manual

Probably introduced at or before Emacs version 28.1.

Key Bindings

Aliases

highlight-phrase