I'm missing the input histories like what's in IPython. But it seems that the defaults do not keep input histories after the comint buffer is killed. Also I'd like to keep them between emacs sessions.
1 Answer
As far as I can tell, comint
offers the variable comint-input-ring-file-name
for this. It wouldn't make much sense to use this globally, because all "frontend" functions that use comint under the hood would mix their history.
Instead, the frontends maintain their own history by making comint-input-ring-file-name
buffer-local and setting it to something suitable.
Examples for how modes do this:
M-x shell
https://github.com/emacs-mirror/emacs/blob/master/lisp/shell.el#L574- ESS https://github.com/emacs-ess/ESS/blob/master/lisp/ess-inf.el#L226
- ipython: https://github.com/eleddy/emacs/blob/master/ipython.el#L244
See also this post where someone discussed the same issue: https://oleksandrmanzyuk.wordpress.com/2011/10/23/a-persistent-command-history-in-emacs/
Also, see savehist the comint input ring
M-x shell
) if I kill that buffer, and then create a new one with the same name, Emacs remembers its history. But, maybe it's reading Bash history for that - I don't know.