idris-hackers / idris-mode

Idris syntax highlighting, compiler-supported editing, interactive REPL and more things for Emacs.
GNU General Public License v3.0
267 stars 70 forks source link

Compute file path to repl history file at runtime if #559

Closed keram closed 1 year ago

keram commented 1 year ago

it is not specified by user using idris-repl-history-file variable.

Why: Previously the idris-repl-history-file used as default hardcoded path ~/.idris/idris-history.eld. However the Idris 2 uses/creates ~/.idris2 directory, meaning if an user with only Idris 2 installed tries to exit Emacs he is prompted with an error:

History file not writable: ~/.idris/idris-history.eld" while saving the
history. Continue? (y or n)

This change also allows users with both Idris and Idris2 installed switch between them just by changing the interpreter variable and have separate repl histories for both version.

keram commented 1 year ago

Fixes https://github.com/idris-hackers/idris-mode/issues/504

jfdm commented 1 year ago

This is interesting, my commit seems to have broken something. I've made one adjustment, but I will merge regardless as it could be a caching issues. It can be fixed later.

jfdm commented 1 year ago

i have found the culprit. Will do a PR with a fix.