Resolve the state files with locate-user-emacs-file - #2145
Merged
Conversation
The known projects file, the frecency store and the session directory were each expanded against user-emacs-directory by hand. Since Emacs 27 a configuration can live in ~/.config/emacs, and locate-user-emacs-file is what knows that - which is why bookmark, recentf, savehist and project.el all go through it. Projectile's three didn't, so they landed in ~/.emacs.d for people whose Emacs state is elsewhere. Nothing moves for a configuration in the usual place, which is what the last spec pins. The :package-version tags are bumped because the default does change for everyone else. The per-project file cache is deliberately untouched: it lives in the project on purpose, and XDG has nothing to offer it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Projectile's three global state paths - the known projects file, the frecency
store and the session directory - were each expanded against
user-emacs-directoryby hand.Since Emacs 27 a configuration can live in
~/.config/emacs, andlocate-user-emacs-fileis the thing that knows it. That's whybookmark,recentf,savehistandproject.el's ownproject-list-fileall go throughit. Projectile's didn't, so for anyone with an XDG-style configuration these
three files were dropped into a
~/.emacs.dthat holds nothing else.Nothing moves for a configuration in the usual place - there's a spec pinning
that. The
:package-versiontags are bumped because the effective default doeschange for everyone else.
Two things deliberately left alone, having looked at what core does with them:
.projectile-cache.eld) stays in the project.That was a considered decision and XDG has nothing to offer it.
xdg-cache-home. Core does use it -org-persistandtrampboth do - but only for data that regenerates freely. Projectile'sfrecency store is earned: losing it to a cache clear would quietly degrade
find-file ranking with nothing to indicate why. The known projects and the
saved sessions are irreplaceable outright.
Also worth noting for anyone wondering about
no-littering: it already themesthese paths individually, and this change doesn't interfere with that.