From: Mark Oteiza Date: Tue, 4 Oct 2016 14:17:53 +0000 (-0400) Subject: Avoid dynamic binding on a symbol X-Git-Tag: emacs-26.0.90~1514 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6d6c93f4cc02d5c03b2f0ec9e565d61a50677e14;p=emacs.git Avoid dynamic binding on a symbol 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. --- diff --git a/lisp/replace.el b/lisp/replace.el index 42567516e47..4fc48d4c7a8 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -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)