XDG Base Directory Compliance#431
XDG Base Directory Compliance#431emillon merged 1 commit intoocaml-community:masterfrom Skyb0rg007:master
Conversation
|
While I did consider using |
emillon
left a comment
There was a problem hiding this comment.
Thanks a lot for adapting your work. some minor comments but this looks good!
|
also, please add the dependency in the opam file as well. |
|
The history file should live in |
|
This will get released in dune 3.9.0 which should be out in a bit less than 2 weeks. It's unlikely that there'll be a utop release in the meantime so we can just wait for it to be available. |
|
I rebased and used the function from xdg now it's available. |
This uses xdg to load files in the right place.
CHANGES: * Fix behavior of utop -stdin (ocaml-community/utop#434, fixes ocaml-community/utop#433, @tuohy) * Handle bounds with `Zed.next_error` (ocaml-community/utop#442, @tmattio) * Load files from XDG directories (the legacy paths still work). (ocaml-community/utop#431, @Skyb0rg007) * Remove deprecated values `prompt_continue`, `prompt_comment`, `smart_accept`, `new_prompt_hooks`, `at_new_prompt` (#..., @emillon) * Require OCaml 4.11.0 or newer. (ocaml-community/utop#444, @emillon)
|
Thanks for all your work giving feedback! |
This PR adds support for the XDG Base Directory Specification by moving the
~/.utop-historyand~/.utoprcfiles to$XDG_CACHE_HOME/utop-historyand$XDG_CONFIG_HOME/utop/utoprcrespectively.Both of these changes still support fallbacks to their original locations to not introduce a strict backwards incompatibility.
While this history file should really be saved as
$XDG_STATE_HOME/utop-history, the XDG state directory is currently unsupported in the current version of lambda-term. I have filed a PR to that project here to add the functionality for downstream use here.This PR improves on #362 by utilizing the existing dependency on lambda-term, and also updating the location of the
utoprcfile location.