* lisp/replace.el (query-replace-read-from): Use minibuffer-with-setup-hook
to set minibuffer-local value of text-property-default-nonsticky. (Bug#23418, bug#23127)
This commit is contained in:
parent
0932b94897
commit
3fe3510728
1 changed files with 9 additions and 12 deletions
|
@ -191,18 +191,15 @@ wants to replace FROM with TO."
|
||||||
;; a region in order to specify the minibuffer input.
|
;; a region in order to specify the minibuffer input.
|
||||||
;; That should not clobber the region for the query-replace itself.
|
;; That should not clobber the region for the query-replace itself.
|
||||||
(save-excursion
|
(save-excursion
|
||||||
;; The `with-current-buffer' ensures that the binding
|
(minibuffer-with-setup-hook
|
||||||
;; for `text-property-default-nonsticky' isn't a buffer
|
(lambda ()
|
||||||
;; local binding in the current buffer, which
|
(setq-local text-property-default-nonsticky
|
||||||
;; `read-from-minibuffer' wouldn't see.
|
|
||||||
(with-current-buffer (window-buffer (minibuffer-window))
|
|
||||||
(let ((text-property-default-nonsticky
|
|
||||||
(cons '(separator . t) text-property-default-nonsticky)))
|
(cons '(separator . t) text-property-default-nonsticky)))
|
||||||
(if regexp-flag
|
(if regexp-flag
|
||||||
(read-regexp prompt nil 'query-replace-from-to-history)
|
(read-regexp prompt nil 'query-replace-from-to-history)
|
||||||
(read-from-minibuffer
|
(read-from-minibuffer
|
||||||
prompt nil nil nil 'query-replace-from-to-history
|
prompt nil nil nil 'query-replace-from-to-history
|
||||||
(car (if regexp-flag regexp-search-ring search-ring)) t))))))
|
(car (if regexp-flag regexp-search-ring search-ring)) t)))))
|
||||||
(to))
|
(to))
|
||||||
(if (and (zerop (length from)) query-replace-defaults)
|
(if (and (zerop (length from)) query-replace-defaults)
|
||||||
(cons (caar query-replace-defaults)
|
(cons (caar query-replace-defaults)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue