changeset 79852:32dc15103b58

(comint-regexp-arg): Fix no-input case.
author Glenn Morris <rgm@gnu.org>
date Wed, 16 Jan 2008 08:10:15 +0000
parents aa48f4550439
children 01593154d6b4
files lisp/comint.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Wed Jan 16 04:17:13 2008 +0000
+++ b/lisp/comint.el	Wed Jan 16 08:10:15 2008 +0000
@@ -1021,9 +1021,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))))