Function: read-regexp-suggestions

read-regexp-suggestions is a byte-compiled function defined in replace.el.gz.

Signature

(read-regexp-suggestions)

Documentation

Return a list of standard suggestions for read-regexp.

By default, the list includes the active region, the identifier
(a.k.a. "tag") at point (see Info node (emacs) Identifier Search),
the last isearch regexp, the last isearch string, and the last replacement regexp. read-regexp appends the list returned by this function to the end of values available via M-n (next-history-element).

Source Code

;; Defined in /usr/src/emacs/lisp/replace.el.gz
(defun read-regexp-suggestions ()
  "Return a list of standard suggestions for `read-regexp'.
By default, the list includes the active region, the identifier
(a.k.a. \"tag\") at point (see Info node `(emacs) Identifier Search'),
the last isearch regexp, the last isearch string, and the last
replacement regexp.  `read-regexp' appends the list returned
by this function to the end of values available via
\\<minibuffer-local-map>\\[next-history-element]."
  (list
   (when (use-region-p)
     (buffer-substring-no-properties
      (region-beginning) (region-end)))
   (find-tag-default-as-regexp)
   (find-tag-default-as-symbol-regexp)
   (car regexp-search-ring)
   (regexp-quote (or (car search-ring) ""))
   (car (symbol-value query-replace-from-history-variable))))