>> 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() >> ... > > It seems to make a lot of sense to have comint-after-pmark-p return nil > instead. WDYT? Good idea. The patch at the end of this message also always checks if the prompt is empty at the end of the shell buffer to exclude Async Shell Command buffers and inactive shells. >> 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? > > My use case is using a function (or in Erlang's lingo a light-weight > process) to communicate with a remote Erlang shell. So there is no > process as comint/emacs understands. Nice, good to know, as these days I completely switched to Elixir.