]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid dynamic binding on a symbol
authorMark Oteiza <mvoteiza@udel.edu>
Tue, 4 Oct 2016 14:17:53 +0000 (10:17 -0400)
committerMark Oteiza <mvoteiza@udel.edu>
Tue, 4 Oct 2016 14:26:38 +0000 (10:26 -0400)
Instead, bind history in the default minibuffer-history.
Fixes bug#24580.
* lisp/replace.el (query-replace-read-from): Let-bind
minibuffer-history.  Change read-regexp and read-from-minibuffer's
HISTORY arguments to nil so that they use minibuffer-history.

lisp/replace.el

index 42567516e479692ce9503ccfc78ddc16e54a04da..4fc48d4c7a8fbcbccc480298bd2d39551b84fa78 100644 (file)
@@ -174,7 +174,7 @@ wants to replace FROM with TO."
              (propertize "\0"
                          'display query-replace-from-to-separator
                          'separator t)))
-          (query-replace-from-to-history
+          (minibuffer-history
            (append
             (when separator
               (mapcar (lambda (from-to)
@@ -186,7 +186,7 @@ wants to replace FROM with TO."
           (minibuffer-allow-text-properties t) ; separator uses text-properties
           (prompt
            (if (and query-replace-defaults separator)
-               (format "%s (default %s): " prompt (car query-replace-from-to-history))
+               (format "%s (default %s): " prompt (car minibuffer-history))
              (format "%s: " prompt)))
           (from
            ;; The save-excursion here is in case the user marks and copies
@@ -198,9 +198,9 @@ wants to replace FROM with TO."
                     (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-regexp prompt)
                   (read-from-minibuffer
-                   prompt nil nil nil 'query-replace-from-to-history
+                   prompt nil nil nil nil
                    (car (if regexp-flag regexp-search-ring search-ring)) t)))))
            (to))
       (if (and (zerop (length from)) query-replace-defaults)