diff options
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 169fc3f4701..0b25200be57 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -191,18 +191,15 @@ wants to replace FROM with TO." | |||
| 191 | ;; a region in order to specify the minibuffer input. | 191 | ;; a region in order to specify the minibuffer input. |
| 192 | ;; That should not clobber the region for the query-replace itself. | 192 | ;; That should not clobber the region for the query-replace itself. |
| 193 | (save-excursion | 193 | (save-excursion |
| 194 | ;; The `with-current-buffer' ensures that the binding | 194 | (minibuffer-with-setup-hook |
| 195 | ;; for `text-property-default-nonsticky' isn't a buffer | 195 | (lambda () |
| 196 | ;; local binding in the current buffer, which | 196 | (setq-local text-property-default-nonsticky |
| 197 | ;; `read-from-minibuffer' wouldn't see. | 197 | (cons '(separator . t) text-property-default-nonsticky))) |
| 198 | (with-current-buffer (window-buffer (minibuffer-window)) | 198 | (if regexp-flag |
| 199 | (let ((text-property-default-nonsticky | 199 | (read-regexp prompt nil 'query-replace-from-to-history) |
| 200 | (cons '(separator . t) text-property-default-nonsticky))) | 200 | (read-from-minibuffer |
| 201 | (if regexp-flag | 201 | prompt nil nil nil 'query-replace-from-to-history |
| 202 | (read-regexp prompt nil 'query-replace-from-to-history) | 202 | (car (if regexp-flag regexp-search-ring search-ring)) t))))) |
| 203 | (read-from-minibuffer | ||
| 204 | prompt nil nil nil 'query-replace-from-to-history | ||
| 205 | (car (if regexp-flag regexp-search-ring search-ring)) t)))))) | ||
| 206 | (to)) | 203 | (to)) |
| 207 | (if (and (zerop (length from)) query-replace-defaults) | 204 | (if (and (zerop (length from)) query-replace-defaults) |
| 208 | (cons (caar query-replace-defaults) | 205 | (cons (caar query-replace-defaults) |