diff options
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 5fe8ad43d22..7876f9bb47c 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -69,6 +69,12 @@ strings or patterns." | |||
| 69 | :group 'matching | 69 | :group 'matching |
| 70 | :version "22.1") | 70 | :version "22.1") |
| 71 | 71 | ||
| 72 | (defcustom query-replace-show-replacement t | ||
| 73 | "*Non-nil means to show what actual replacement text will be." | ||
| 74 | :type 'boolean | ||
| 75 | :group 'matching | ||
| 76 | :version "23.1") | ||
| 77 | |||
| 72 | (defcustom query-replace-highlight t | 78 | (defcustom query-replace-highlight t |
| 73 | "*Non-nil means to highlight matches during query replacement." | 79 | "*Non-nil means to highlight matches during query replacement." |
| 74 | :type 'boolean | 80 | :type 'boolean |
| @@ -1570,10 +1576,17 @@ make, or the user didn't cancel the call." | |||
| 1570 | (or delimited-flag regexp-flag) case-fold-search) | 1576 | (or delimited-flag regexp-flag) case-fold-search) |
| 1571 | ;; Bind message-log-max so we don't fill up the message log | 1577 | ;; Bind message-log-max so we don't fill up the message log |
| 1572 | ;; with a bunch of identical messages. | 1578 | ;; with a bunch of identical messages. |
| 1573 | (let ((message-log-max nil)) | 1579 | (let ((message-log-max nil) |
| 1580 | (replacement-presentation | ||
| 1581 | (if query-replace-show-replacement | ||
| 1582 | (save-match-data | ||
| 1583 | (set-match-data real-match-data) | ||
| 1584 | (match-substitute-replacement next-replacement | ||
| 1585 | nocasify literal)) | ||
| 1586 | next-replacement))) | ||
| 1574 | (message message | 1587 | (message message |
| 1575 | (query-replace-descr from-string) | 1588 | (query-replace-descr from-string) |
| 1576 | (query-replace-descr next-replacement))) | 1589 | (query-replace-descr replacement-presentation))) |
| 1577 | (setq key (read-event)) | 1590 | (setq key (read-event)) |
| 1578 | ;; Necessary in case something happens during read-event | 1591 | ;; Necessary in case something happens during read-event |
| 1579 | ;; that clobbers the match data. | 1592 | ;; that clobbers the match data. |