[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 3fe3510: * lisp/replace.el (query-replace-read-fr
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] emacs-25 3fe3510: * lisp/replace.el (query-replace-read-from): Use minibuffer-with-setup-hook |
Date: |
Wed, 04 May 2016 20:05:44 +0000 |
branch: emacs-25
commit 3fe351072841becbb1902c19f784890949f41c1d
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>
* 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)
---
lisp/replace.el | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/lisp/replace.el b/lisp/replace.el
index 801c605..26e5875 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -191,18 +191,15 @@ wants to replace FROM with TO."
;; a region in order to specify the minibuffer input.
;; That should not clobber the region for the query-replace itself.
(save-excursion
- ;; The `with-current-buffer' ensures that the binding
- ;; for `text-property-default-nonsticky' isn't a buffer
- ;; local binding in the current buffer, which
- ;; `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)))
- (if regexp-flag
- (read-regexp prompt nil 'query-replace-from-to-history)
- (read-from-minibuffer
- prompt nil nil nil 'query-replace-from-to-history
- (car (if regexp-flag regexp-search-ring search-ring))
t))))))
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (setq-local text-property-default-nonsticky
+ (cons '(separator . t)
text-property-default-nonsticky)))
+ (if regexp-flag
+ (read-regexp prompt nil 'query-replace-from-to-history)
+ (read-from-minibuffer
+ prompt nil nil nil 'query-replace-from-to-history
+ (car (if regexp-flag regexp-search-ring search-ring)) t)))))
(to))
(if (and (zerop (length from)) query-replace-defaults)
(cons (caar query-replace-defaults)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 3fe3510: * lisp/replace.el (query-replace-read-from): Use minibuffer-with-setup-hook,
Juri Linkov <=