changeset 87786:4889ff88791b

(comint-regexp-arg): Fix no-input case.
author Glenn Morris <rgm@gnu.org>
date Wed, 16 Jan 2008 08:10:54 +0000
parents 8f1628da223f
children 4c03765b3435
files lisp/comint.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Wed Jan 16 06:22:59 2008 +0000
+++ b/lisp/comint.el	Wed Jan 16 08:10:54 2008 +0000
@@ -1022,9 +1022,11 @@
 	 (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))))