Variable: query-replace-show-preview

query-replace-show-preview is a customizable variable defined in replace.el.gz.

Value

nil

Documentation

Non-nil means show a preview of the result of a replacement.

The matches visible in the window are shown as they would look after the replacement. Replacements using \, or \# are not previewed.

The value can be nil, for no preview; the symbol replacement-only, to show the replacement alone; the symbol both, to show the match and the replacement side by side; or a function of two string arguments, the match and the replacement, returning the string to show in place of the match, or nil to leave that match alone. See the functions replace-preview-replacement-only and replace-preview-both for two examples of such a function.

This variable was added, or its default value changed, in Emacs 32.1.

View in manual

Probably introduced at or before Emacs version 32.1.

Source Code

;; Defined in /usr/src/emacs/lisp/replace.el.gz
(defcustom query-replace-show-preview nil
  "Non-nil means show a preview of the result of a replacement.
The matches visible in the window are shown as they would look after the
replacement.  Replacements using \\, or \\# are not previewed.

The value can be nil, for no preview; the symbol `replacement-only', to
show the replacement alone; the symbol `both', to show the match and the
replacement side by side; or a function of two string arguments, the
match and the replacement, returning the string to show in place of the
match, or nil to leave that match alone.  See the functions
`replace-preview-replacement-only' and `replace-preview-both' for two
examples of such a function."
  :type '(choice (const    :tag "No preview" nil)
                 (const    :tag "Show the replacement" replacement-only)
                 (const    :tag "Show both match and replacement" both)
                 (function :tag "Other function"))
  :group 'matching
  :version "32.1")