Function: replace-preview-replacement-only

replace-preview-replacement-only is a byte-compiled function defined in replace.el.gz.

Signature

(replace-preview-replacement-only MATCH REPLACEMENT)

Documentation

Return REPLACEMENT in the face query-replace-preview.

REPLACEMENT is a string. If it is empty, instead of showing nothing at all, return a thin bar to mark the place of the match.

This function is what query-replace-show-preview uses when it is replacement-only.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/replace.el.gz
(defun replace-preview-replacement-only (_match replacement)
  "Return REPLACEMENT in the face `query-replace-preview'.
REPLACEMENT is a string.  If it is empty, instead of showing nothing at
all, return a thin bar to mark the place of the match.

This function is what `query-replace-show-preview' uses when it is
`replacement-only'."
  (let ((text (replace-preview-propertize replacement
                                          'query-replace-preview)))
    (if (equal text "")
        (propertize " " 'face '(query-replace-preview (:height 0.2)))
      text)))