-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XDG Base Directory Compliance #431
Conversation
While I did consider using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-history
and~/.utoprc
files to$XDG_CACHE_HOME/utop-history
and$XDG_CONFIG_HOME/utop/utoprc
respectively.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
utoprc
file location.