Open rpglover64 opened 9 years ago
I came to add this issue now, but first searched and found it exists.
I believe inf-haskell.el is used for haskell-interactive-mode and it uses comint. Maybe this was never added because "it's just comint" so you "just" need to connect a few things?
I think this will work but I haven't tested:
(defun turn-on-comint-history (history-file)
(setq comint-input-ring-file-name history-file)
(comint-read-input-ring 'silent))
(add-hook 'inf-haskell-mode-hook
(lambda ()
(turn-on-comint-history ".ghci")))
(add-hook 'kill-buffer-hook #'comint-write-input-ring)
(add-hook 'kill-emacs-hook
(lambda ()
(--each (buffer-list)
(with-current-buffer it (comint-write-input-ring)))))
Customized from https://emacs.stackexchange.com/questions/9925/persistent-shell-command-historyi
Here are some examples of people using comint-input-ring-file-name in the wild if that doesn't work or you want to find other cool related things.
It would be nice however if this were project specific history imo. One could probably modify the file-name to take project into account to accomplish this pretty easily though.
It would be useful to have history which persisted after an emacs restart.