Ihor Radchenko <yanta...@gmail.com> writes:
> Max Nikulin <maniku...@gmail.com> writes: > >> Ihor, your fix affects linux as well. .cache directory may be missed in >> fresh accounts. E.g. I just have created a new test container (my old >> one has emacs-25): > > After second thought, I am not sure anymore if using XDG is a good idea. > Emacs itself only recently started supporting XDG and the support is > somewhat limited. Similar to the described case with non-existing .cache > directory, Emacs ignores non-existing .config/emacs folder for init.el. > Emacs never creates .config directory. > > So, I can see several options for Org: > 1. Just move to back usual usage of user-emacs-directory and store the > cache there > 2. Use the same approach with Emacs: if $XDG_CACHE_DIR/org-persist > exists and user-emacs-directory/org-persist does not, use the XDG > dir. Otherwise fall back to user-emacs-directory > 3. Same as 2, but only require existing $XDG_CACHE_DIR and create > $XDG_CACHE_DIR/org-persist dir if possible. > 4. Same as 3, but create $XDG_CACHE_DIR if possible. It is similar to > other XDG-complient software (at least, that's what I saw in > qutebrowser code). > I think the key is to be consistent with user expectations. If the user's init.el is under XDG layout, then use that, otherwise use user-emacs-dir. This is slightly different to your No. 2, as I suspect in the first run of org, it could be possible that init.el is under XDG layout, but there is no org-persist yet. Most important requirement would be that the location is a custom variable, allowing easy customisation for those who want to set it explicitly.