Function: query-replace-read-to

query-replace-read-to is a byte-compiled function defined in replace.el.gz.

Signature

(query-replace-read-to FROM PROMPT REGEXP-FLAG &optional DELIMITED-FLAG)

Documentation

Query and return the TO argument of a query-replace operation.

Prompt with PROMPT. REGEXP-FLAG non-nil means the response should a regexp. DELIMITED-FLAG is used to search for the occurrences of FROM when previewing the replacement (see query-replace-show-preview).

Source Code

;; Defined in /usr/src/emacs/lisp/replace.el.gz
(defun query-replace-read-to (from prompt regexp-flag &optional delimited-flag)
  "Query and return the TO argument of a `query-replace' operation.
Prompt with PROMPT.  REGEXP-FLAG non-nil means the response
should a regexp.
DELIMITED-FLAG is used to search for the occurrences of FROM when
previewing the replacement (see `query-replace-show-preview')."
  (query-replace-compile-replacement
   (save-excursion
     (let* ((history-add-new-input nil)
	    (to (minibuffer-with-setup-hook
		    (replace-preview-setup from regexp-flag delimited-flag)
		  (read-from-minibuffer
		   (format "%s %s with: " prompt (query-replace-descr from))
		   nil nil nil
		   query-replace-to-history-variable from t))))
       (add-to-history query-replace-to-history-variable to nil t)
       (add-to-history 'query-replace-defaults (cons from to) nil t)
       to))
   regexp-flag))