Subject: Feature request: put ELN cache in $XDG_CACHE_HOME by default

From: Clément Pit-Claudel <[email-masked]>
Date: Thu, 20 May 2021 13:25:18 -0400

Hi all,

By default the eln cache is stored in .emacs.d/eln-cache.  Would it make sense to store it in $XDG_CACHE_HOME/emacs/eln by default on platforms that obey the XDG spec?

I came across this because my backup scripts already exclude $XDG_CACHE_HOME, but didn't exclude .emacs.d/eln-cache, so I found myself backing up hundreds of megabytes of ELN files.

In a related Reddit discussion, https://www.reddit.com/r/emacs/comments/mltaie/gccemacs_how_to_permanently_change_where_elncache , Steve Purcell wrote:

> Now that emacs honours xdg settings for finding its own config, might it make sense for the eln cache to move to the xdg cache directory?

And Eli Zaretskii responded:

> I don't think so, personally: the XDG spec says the XDG cache directory should hold "user-specific non-essential (cached) data files". The *.eln files don't fit that description: the user would like the files to persist.
>
> That said, feel free to submit a feature-request bug report about this, and let's see what others think about this.

FWIW, I had a quick look through my .cache folder, and it seems that chromium and Firefox both put compiled code in that folder (JS bytecode and compiled Webassembly files).