Summary

XDG basedir support for csi config, egg cache and maybe more

Metadata

Attachments

Description

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://blogs.msdn.microsoft.com/oldnewthing/20050701-09/?p=35133/ https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx

This is a specification that allows users to unclutter their home directory by keeping config files in (a customizable) directory and cache files in another one (also customizable). An example implementation for Unix-likes (where it's safe to assume `HOME` is set) has been attached. Windows has something (almost) comparable in form of the `APPDATA` (for user-specific configuration) and `LOCALAPPDATA` (for user-specific non-configuration, exists since Vista) environment variables. In case `LOCALAPPDATA` isn't defined, `APPDATA` could be used instead. I'm not 100% sure whether you can just use `get-environment-variable` on Windows and have it work, someone would need to test this.

With this we could (for both Windows and Unix-likes):

- Look up a user config/cache directory for the platform - Check whether a config/cache file exists - If yes, read it from that location, otherwise fall back to a default

The last one is optional and might make this a change request. Falling back to a default would preserve default behavior, ignoring it would introduce a change. Possible candidates include `~/.csirc` (config), the egg cache (cache) and setup-defaults (config).

PS: Looking up `.csirc` on Windows probably never worked as it relies on resolving `HOME` which isn't set by default. This would make it work again, albeit for a different location than previously documented.

Changes and comments

[2018-04-28 23:31:38 UTC] wasamasa attached xdg.scm (description=#f)

[2018-05-11 18:12:32 UTC] wasamasa wrote:

Apparently `get-environment-variable` should just work: https://github.com/francisco-colaco/user-directories/blob/master/user-directories/user-directories-windows-nt.el

[2018-11-07 22:50:31 UTC] sjamaan changed version from 5.0 to 5.0.0

[2018-11-07 22:50:31 UTC] sjamaan changed milestone from someday to 5.2

[2018-11-07 22:50:31 UTC] sjamaan wrote:

Let's take a look at this soonish. Maybe for 5.1, but I don't want to overload that milestone so I'm putting it on 5.2.

[2018-11-07 23:23:35 UTC] kooda wrote:

The patch for this has already been submitted to chicken-hackers:

http://lists.nongnu.org/archive/html/chicken-hackers/2018-08/msg00009.html

[2018-11-09 15:20:59 UTC] sjamaan changed version from 5.0.0 to 5.0

[2018-11-25 00:44:07 UTC] sjamaan changed milestone from 5.2 to 5.1

[2018-11-27 11:55:40 UTC] kooda changed status from new to closed

[2018-11-27 11:55:40 UTC] kooda set resolution to fixed

[2018-11-27 11:55:40 UTC] kooda wrote:

Patch pushed as d902e1cfd6d8d9ca8841bc83f30e8547c9f32c2f