Function: hi-lock-read-regexp

hi-lock-read-regexp is a byte-compiled function defined in hi-lock.el.gz.

Signature

(hi-lock-read-regexp PROMPT)

Documentation

Read font-lock pattern from the minibuffer and return it.

The pattern is read using read-regexp with PROMPT and validated using hi-lock-regexp-okay. If the region is active, use its content as the default value.

Source Code

;; Defined in /usr/src/emacs/lisp/hi-lock.el.gz
(defun hi-lock-read-regexp (prompt)
  "Read font-lock pattern from the minibuffer and return it.

The pattern is read using `read-regexp' with PROMPT and validated using
`hi-lock-regexp-okay'.  If the region is active, use its content as the
default value."
  (hi-lock-regexp-okay
   (read-regexp prompt
                (if (use-region-p)
                    (prog1
                        (buffer-substring (region-beginning)
                                          (region-end))
                      (deactivate-mark))
                  'regexp-history-last))))