Commit 7abe68aa authored by Juri Linkov's avatar Juri Linkov
Browse files

(query-replace-show-replacement): New defcustom.

(perform-replace): Use `match-substitute-replacement' if
`query-replace-show-replacement' is non-nil.
parent 8c2e721a
2007-11-10 Paul Pogonyshev <pogonyshev@gmx.net>
* replace.el (query-replace-show-replacement): New defcustom.
(perform-replace): Use `match-substitute-replacement' if
`query-replace-show-replacement' is non-nil.
2007-11-10 David Kastrup <dak@gnu.org>
* subr.el (match-substitute-replacement): New function.
2007-11-10 Carsten Dominik <dominik@science.uva.nl>
* files.el (auto-mode-alist): Select org-mode for files with the
......
......@@ -69,6 +69,12 @@ strings or patterns."
:group 'matching
:version "22.1")
(defcustom query-replace-show-replacement t
"*Non-nil means to show what actual replacement text will be."
:type 'boolean
:group 'matching
:version "23.1")
(defcustom query-replace-highlight t
"*Non-nil means to highlight matches during query replacement."
:type 'boolean
......@@ -1570,10 +1576,17 @@ make, or the user didn't cancel the call."
(or delimited-flag regexp-flag) case-fold-search)
;; Bind message-log-max so we don't fill up the message log
;; with a bunch of identical messages.
(let ((message-log-max nil))
(let ((message-log-max nil)
(replacement-presentation
(if query-replace-show-replacement
(save-match-data
(set-match-data real-match-data)
(match-substitute-replacement next-replacement
nocasify literal))
next-replacement)))
(message message
(query-replace-descr from-string)
(query-replace-descr next-replacement)))
(query-replace-descr replacement-presentation)))
(setq key (read-event))
;; Necessary in case something happens during read-event
;; that clobbers the match data.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment