Function: replace-preview--input
replace-preview--input is a byte-compiled function defined in
replace.el.gz.
Signature
(replace-preview--input FROM CONTENTS)
Documentation
Return the pair of strings to preview, or nil if there is none.
FROM is the string to search for and CONTENTS is the minibuffer input,
which is then the replacement text. FROM nil means that CONTENTS holds
both halves, as at the prompt of query-replace-read-from, which splits
them on the separator text property; until the input has both of them,
there is nothing to preview, and this function returns nil.
Value is either a cons cell of the two strings to show in preview, or nil.
Source Code
;; Defined in /usr/src/emacs/lisp/replace.el.gz
(defun replace-preview--input (from contents)
"Return the pair of strings to preview, or nil if there is none.
FROM is the string to search for and CONTENTS is the minibuffer input,
which is then the replacement text. FROM nil means that CONTENTS holds
both halves, as at the prompt of `query-replace-read-from', which splits
them on the `separator' text property; until the input has both of them,
there is nothing to preview, and this function returns nil.
Value is either a cons cell of the two strings to show in preview, or nil."
(if from
(cons from (substring-no-properties contents))
(let ((split (query-replace--split-string contents)))
(when (consp split)
(cons (substring-no-properties (car split)) (cdr split))))))