From 2511035dc74e5637fb020eefdb193f3dd3e810b8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 19 Feb 2005 13:12:21 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 6 +++++- lisp/replace.el | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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) -- 2.39.2