summaryrefslogtreecommitdiff
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2008-01-16 08:10:36 +0000
committerGlenn Morris <rgm@gnu.org>2008-01-16 08:10:36 +0000
commit2d216b52ea90383bda098aea2786dba39d4d8251 (patch)
tree937bec55675b2ac07e61d6259100c9464e9d05fd /lisp/comint.el
parent5525a92a34aff85e9754b0cca1ba84f83a83673b (diff)
downloademacs-2d216b52ea90383bda098aea2786dba39d4d8251.tar.gz
(comint-regexp-arg): Fix no-input case.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el6
1 files changed, 4 insertions, 2 deletions
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))))