Subject: Re: master a710f8a: * lisp/comint.el (comint-history-isearch-setup): Check if process is live.

From: Juri Linkov <[email-masked]>
Date: Wed, 07 Feb 2018 23:20:02 +0200

> Changing comint-history-isearch-setup this way seems too pervasive. I
> have a use case where (get-buffer-process (current-buffer)) is always
> nil. Is there another way to work around the issue in *Async Shell
> Command*? Thanks.

Before this fix the search was broken in *Async Shell Command*
and in inactive shells.

For example, try to set comint-history-isearch to ‘dwim’
and type ‘C-r’ in a *Async Shell Command* buffer.  It fails with

  Lisp error: (wrong-type-argument processp nil)
  process-mark(nil)
  comint-after-pmark-p()
  comint-history-isearch-setup()
  ...

Or even when comint-history-isearch is nil by default, run shell ‘M-x shell’,
then exit it, and after “Process shell finished” type ‘M-r’ and any letter
to search for it:

  Lisp error: (wrong-type-argument processp nil)
  process-mark(nil)
  comint-delete-input()
  comint-goto-input(nil)
  comint-history-isearch-pop-state
  ...

In these cases the history can't be searched because there is no active shell.
I wonder what use case do you need in inactive shells without a prompt,
so it's impossible to search in the history.  How you used to search
through the shell history without failing in ‘comint-goto-input’ like
in the backtrace above?