From 2d216b52ea90383bda098aea2786dba39d4d8251 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 16 Jan 2008 08:10:36 +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 a9e8fa4fbfb..12621959992 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 Ulf Jasper * calendar/icalendar.el (icalendar-export-file) diff --git a/lisp/comint.el b/lisp/comint.el index 0a22cdba5c9..f8a47152976 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1021,9 +1021,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