Subject: bug#583: closed (Re: Use XDG basedir spec for configuration files?)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 27 Aug 2019 21:59:02 +0000

Your bug report

#583: Use XDG basedir spec for configuration files?

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
583: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=583
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: Use XDG basedir spec for configuration files?
From: Paul Eggert <[email-masked]>
To: [email-masked]
Cc: [email-masked], Eli Zaretskii <[email-masked]>,Jan Djärv <[email-masked]>, Eric Heintzmann <[email-masked]>
Date: Tue, 27 Aug 2019 14:57:55 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

After discussion we added something along the suggested lines to Emacs master here:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4118297ae2fab4886b20d193ba511a229637aea3

so I am closing bug report number 583.

>From [email-masked] Sun Jul 20 23:59:46 2008
Date: Mon, 21 Jul 2008 08:59:30 +0200
From: Fernando <[email-masked]>
Reply-To: [email-masked]
To: [email-masked]
Subject: Use XDG basedir spec for configuration files?

------=_Part_66254_24778329.1216623570281
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

The XDG Base Directory
Specification<http://standards.freedesktop.org/basedir-spec/>provides
some common paths in user's home to store personal application
configurations, or, using their own words "*defines where these files should
be looked for by defining one or more base directories relative to which
files should be located*".

XDG Base Directory Specification allows efficient backup, in which you can
easily choose to backup your data and/or your configuration files for
instance. An application could easily propose such backup for the whole
system if all applications were matching these specification.

Therefore, although I think that this bug/enhancement is not vital, it would
be great for Emacs to be "FreeDesktop XDG Base Directory Specification"
compliant.

Currently Emacs is using "$HOME/.emacs.d/". This is what XDG basedir spec
defines:

   - $XDG_DATA_HOME (usually $HOME/.local/share/) as "*the base directory
   relative to which user specific data files should be stored*"
   - $XDG_CONFIG_HOME (usually $HOME/.config/) as "*the base directory
   relative to which user specific configuration files should be stored*"
   - $XDG_CACHE_HOME (usually $HOME/.cache/) as "*the base directory
   relative to which user specific non-essential data files should be stored
   *"

(http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)

In order to make Emacs XDG basedir compliant, I think that it would be nice
to use:

   - $XDG_CONFIG_HOME/emacs  ;;for "init.el" and storing customize
   configuration

   - $XDG_DATA_HOME/emacs  ;;for sessions and backups

   - $XDG_CACHE_HOME/emacs  ;;for cache files

Or maybe some other distribution. What do you think about it?

There's a small C library that may be useful check it out, written for the
sole purpose of xdg basedir spec compliance:
https://n.ethz.ch/student/nevillm/download/libxdg-basedir/

------=_Part_66254_24778329.1216623570281
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr"><p>
<font size="2"><span style="font-family: arial,sans-serif;">The </span><a style="font-family: arial,sans-serif;" href="http://standards.freedesktop.org/basedir-spec/" target="_blank"><span>XDG Base Directory Specification</span></a><span style="font-family: arial,sans-serif;"> provides some common paths in user&#39;s home to store personal application configurations, or, using their own words &quot;</span><i style="font-family: arial,sans-serif;">defines
where these files should be looked for by defining one or more base
directories relative to which files should be located</i><span style="font-family: arial,sans-serif;">&quot;. </span><br style="font-family: arial,sans-serif;"></font></p><p style="font-family: arial,sans-serif;"><font size="2">
XDG Base Directory Specification allows efficient backup, in which you
can easily choose to backup your data and/or your configuration files
for instance. An application could easily propose such backup for the whole system if all applications were matching these specification.
</font></p>

<p style="font-family: arial,sans-serif;"><font size="2">
Therefore, although I think that this bug/enhancement is not vital, it
would be great for Emacs to be &quot;FreeDesktop XDG Base Directory
Specification&quot; compliant.&nbsp;</font></p>

<p style="font-family: arial,sans-serif;"><font size="2">Currently Emacs is using &quot;$HOME/.emacs.d/&quot;. This is what XDG basedir spec defines:
</font></p>
<ul style="font-family: arial,sans-serif;"><li><font size="2">$XDG_DATA_HOME (usually $HOME/.local/share/) as &quot;<i>the base directory relative to which user specific data files should be stored</i>&quot; 
</font></li><li><font size="2">$XDG_CONFIG_HOME (usually $HOME/.config/) as &quot;<i>the base directory relative to which user specific configuration files should be stored</i>&quot;
</font></li><li><font size="2">$XDG_CACHE_HOME (usually $HOME/.cache/) as &quot;<i>the base directory relative to which user specific non-essential data files should be stored</i>&quot;</font></li></ul><p style="font-family: arial,sans-serif;">
<font size="2">(<a href="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html</a>)<br></font></p><p style="font-family: arial,sans-serif;">
<font size="2">
In order to make Emacs XDG basedir compliant, I think that it would
be nice to use:</font></p><ul><li><font size="2">$XDG_CONFIG_HOME/emacs&nbsp; ;;for &quot;init.el&quot; and storing customize configuration</font></li></ul><ul><li><font size="2">$XDG_DATA_HOME/emacs&nbsp; ;;for sessions and backups<br>
</font></li></ul><ul><li><font size="2">$XDG_CACHE_HOME/emacs&nbsp; ;;for cache files <br></font></li></ul><p style="font-family: arial,sans-serif;">Or maybe some other distribution. What do you think about it?<br></p><font size="2"><br>
</font><font size="2">There&#39;s a small C library that may be useful check it out, written for the sole purpose of xdg basedir spec compliance: <a href="https://n.ethz.ch/student/nevillm/download/libxdg-basedir/" target="_blank">https://n.ethz.ch/student/nevillm/download/libxdg-basedir/</a><br>

</font></div>

------=_Part_66254_24778329.1216623570281--