# HG changeset patch # User Glenn Morris # Date 1200471054 0 # Node ID 4889ff88791bcf4e2e854a6670d786236a6802df # Parent 8f1628da223f3816a5354b8574bb82244bcd4f60 (comint-regexp-arg): Fix no-input case. diff -r 8f1628da223f -r 4889ff88791b lisp/comint.el --- 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))))