Skip to content
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

Consider following the XDG base-dir specification #224

Closed
5 tasks
nspaeth opened this issue Aug 20, 2022 · 6 comments
Closed
5 tasks

Consider following the XDG base-dir specification #224

nspaeth opened this issue Aug 20, 2022 · 6 comments

Comments

@nspaeth
Copy link
Contributor

nspaeth commented Aug 20, 2022

Consider following the The XDG base-dir specification more closely, which defines the following environment variables:

  • $XDG_DATA_HOME - user-specific data files default: $HOME/.local/share
  • Could use for ELPA directory.
  • $XDG_CONFIG_HOME - user-specific configuration files default: $HOME/.config
  • Currently using $XDG_CONFIG_HOME/crafted-emacs
  • $XDG_STATE_HOME user-specific state data default: $HOME/.local/state
    contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME. It may contain:
    • actions history (logs, history, recently used files, …)
    • current state of the application that can be reused on a restart (view, layout, open files, undo history, …)
  • $XDG_CACHE_HOME - user-specific non-essential (cached) data default:* $HOME/.cache
  • Could use for .elc files?
  • $XDG_RUNTIME_DIR - user-specific runtime files and other file objects default: $HOME/.local/bin
  • Could use for lock files?

My $XDG_CONFIG_HOME/crafted-emacs/ currently contains the directories var/ elpa/ and etc/, which could be symlinked to their XDG counterparts.

I feel like following this specification and other standards, although not explicitly stated, aligns with the spirit of this project. I also think that it would make it easier for people to ignore non-essential files in their backups or version-controlled configs.

@jeffbowman
Copy link
Contributor

XDG directory structure is not portable to Microsoft Windows. Not against a PR for this work, per se, but would prefer a flag to turn it on or off at the users preference. Consider the comments in #176 .

People are pretty used to having all of their Emacs configuration contained in the user-emacs-directory and we break that a bit currently by moving things to the crafted-config-path instead as an attempt to keep the user-emacs-directory relatively clean. That has already caused some questions (like "why did we do that anyway?"), so I can't imagine an XDG setup would be any more well received. I could be wrong though.

@nspaeth
Copy link
Contributor Author

nspaeth commented Aug 24, 2022

I should have search the existing issues!

XDG directory structure is not portable to Microsoft Windows.

I guess that depends on whether or not you agree with this interpretation.

Either way, I agree that this functionality should exist behind a flag given its divergence from emacs history.

After seeing the discussion in other issues I think I could tackle a pull request this weekend for review.

@jeffbowman
Copy link
Contributor

I look forward to your PR. You might consider looking into the built-in xdg elisp package as well.

@ajxn
Copy link
Contributor

ajxn commented Oct 5, 2022

Is there any work going on this? It would been great to have this in Crafted-Emacs.

@jeffbowman
Copy link
Contributor

I thought @nspaeth was working on a PR, haven't seen anything come in, and I'm not working on it personally.

@jeffbowman
Copy link
Contributor

Closing in anticipation of Crafted Emacs V2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants