From b11a06ccc7ea7e282e435bf4b3e46f4ed3bee9f1 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 16 Jan 2008 08:11:05 +0000 Subject: [PATCH] (comint-regexp-arg): Fix no-input case. --- lisp/ChangeLog | 4 ++++ lisp/comint.el | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8ae0d57023d..b1d4e26dfdb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2008-01-16 Glenn Morris + + * comint.el (comint-regexp-arg): Fix no-input case. + 2008-01-16 Dan Nicolaescu * smerge-mode.el (smerge-start-session): Rename from smerge-auto. diff --git a/lisp/comint.el b/lisp/comint.el index 6fb89e28181..70d6f85ff68 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1022,9 +1022,11 @@ See also `comint-read-input-ring'." (last-command last-command) (regexp (read-from-minibuffer prompt nil nil nil 'minibuffer-history-search-history))) + ;; If the user didn't enter anything, nothing is added to m-h-s-h. + ;; Use the previous search regexp, if there is one. (list (if (string-equal regexp "") - (setcar minibuffer-history-search-history - (nth 1 minibuffer-history-search-history)) + (or (car minibuffer-history-search-history) + regexp) regexp) (prefix-numeric-value current-prefix-arg)))) -- 2.39.2