From: Eli Zaretskii Date: Sat, 19 Feb 2005 13:12:21 +0000 (+0000) Subject: (query-replace-read-from): Set the value of X-Git-Tag: ttn-vms-21-2-B4~2200 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2511035dc74e5637fb020eefdb193f3dd3e810b8;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b7e5c29d00..9ea146cd6c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,8 @@ -2005-02-19 Eli Zaretskii +2005-02-19 Michael Mauger + + * 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. diff --git a/lisp/replace.el b/lisp/replace.el index de3577913c1..eb9f592f01d 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -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)