]> git.eshelyaron.com Git - emacs.git/commitdiff
(query-replace-read-from): Set the value of
authorEli Zaretskii <eliz@gnu.org>
Sat, 19 Feb 2005 13:12:21 +0000 (13:12 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 19 Feb 2005 13:12:21 +0000 (13:12 +0000)
query-replace-from-history-variable to handle the case of an empty
string entered to accept the suggested default.

lisp/ChangeLog
lisp/replace.el

index 9b7e5c29d00a870d7ebafdb8e6eaa4e8020d176d..9ea146cd6c628768b38b045e6f79e792b2372ebb 100644 (file)
@@ -1,4 +1,8 @@
-2005-02-19  Eli Zaretskii  <eliz@gnu.org>
+2005-02-19  Michael Mauger  <mmaug@yahoo.com>
+
+       * replace.el (query-replace-read-from): Set the value of
+       query-replace-from-history-variable to handle the case of an empty
+       string entered to accept the suggested default.
 
        * net/tramp.el (tramp-file-name-for-operation): Use
        dired-call-process instead of dired-call-process-command.
index de3577913c185da572cbea796f0c3f753e316df7..eb9f592f01dd56b0d5893833007ee604dea0ac74 100644 (file)
@@ -115,8 +115,11 @@ wants to replace FROM with TO."
               query-replace-from-history-variable
               nil t t))))
       (if (and (zerop (length from)) lastto lastfrom)
-         (cons lastfrom
-               (query-replace-compile-replacement lastto regexp-flag))
+         (progn
+           (cons lastfrom
+                 (query-replace-compile-replacement lastto regexp-flag))
+           (set query-replace-from-history-variable
+                (cdr (symbol-value query-replace-from-history-variable))))
        ;; Warn if user types \n or \t, but don't reject the input.
        (and regexp-flag
             (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)