From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Amin Bandali Newsgroups: gmane.emacs.devel Subject: Cleaning up and structuring user-emacs-directory (was: A cache directory?) Date: Sun, 16 Aug 2020 16:10:12 -0400 Organization: GNU Message-ID: <871rk6uzbv.fsf@gnu.org> References: <677E1813-9A0E-4127-9814-36CB9AB8B744@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27655"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 16 22:10:44 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k7OzL-00074c-MN for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Aug 2020 22:10:43 +0200 Original-Received: from localhost ([::1]:46480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7OzK-000379-P5 for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Aug 2020 16:10:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7Oys-0002cA-0d for emacs-devel@gnu.org; Sun, 16 Aug 2020 16:10:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43599) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7Oyr-0000js-O5 for emacs-devel@gnu.org; Sun, 16 Aug 2020 16:10:13 -0400 Original-Received: from [2607:fea8:3fdf:f688::8] (port=45174 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k7Oyr-00037S-Dw for emacs-devel@gnu.org; Sun, 16 Aug 2020 16:10:13 -0400 Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: <677E1813-9A0E-4127-9814-36CB9AB8B744@gmail.com> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253864 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Yuan Fu writes: > Maybe this has been discussed but I can=E2=80=99t find any threads in the > archive. .emacs.d is pretty crowded: every package puts their > temporary files under it. I wonder if there could be a standard cache > directory? I know there are packages that's solely for this purpose: > resetting every single xxx-file to be under a cache > directory. However, it would be better if there is just a standard one > and everybody uses it. > [...] I too have found myself generally displeased with how various packages create arbitrary files in my `user-emacs-directory'. I would personally like to see this issue tackled more generally, for different sorts of files rather than just cache/temporary files. Of the packages that aim to do this, I liked the approach of the "no-littering" package like the most. Essentially, it designates two directories, one for config files and another for persistent data files, defaulting to "etc/" and "var/" under the `user-emacs-directory' respectively. It then changes the directory/file location settings for many packages, dividing up each package's files into one of the two general categories. If a package stores multiple files of the same category, no-littering creates a directory under that category with the package name to keep those files together. If we were to tackle this in Emacs itself, maybe we could have two defcustoms `user-config-directory' and `user-data-directory', defaulting to "etc/" and "var/" in `user-emacs-directory'. If a lot of packages use temporary/cache files, having a third `user-cache-directory' that defaults to "var/cache/" in `user-emacs-directory' would make sense. We could then ask packages to use one of these variables when defining their file locations, rather than `user-emacs-directory' directly. To avoid disruptions for users with existing files, we could take a similar approach as the recently added XDG support, using the current location for existing files, but defaulting to the new location for each file that doesn't exist. Perhaps an FHS-like [0] directory structure in `user-emacs-directory' was always inevitable, since Emacs is an operating system after all. ;-) [0]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJEBAEBCAAuFiEEObM8jZRIDS3cwqSYi0Sgzce5VvIFAl85kqQQHGJhbmRhbGlA Z251Lm9yZwAKCRCLRKDNx7lW8oO9D/9JtCJZ6E1wGV3Ac0cFN2SIwEbk69vzVDdL 7+YHtNqEvoH2u/YM/GLuyDcFlgMZefZ+d74AEJp2+q5q8LWaqHCvjQgqVtGcrevd udXZeJlqxWASgirodW+ipO6QCiQ1zgRQp0lvBtOKSR0T9xHWT8gmvwrfUjgF8t1Z 21yyw+yitPpTAJZxkt3XUfaSFKMHBLd8A8lpVyfIreJj3WkTQD2i3tQ7a9EQmYf/ aikDJ1t9n25vtc9sYtW+nb9GWotV5OHGLO3OQZ5Tq1ROr190eNX4rVW/utD/zGI3 VsVxPBgvNiE1dFjFBjLd3c1U7w/DJC/1/2Ooarty8lzhjt8Icqe3yz8bCaiIipUb meqWTbvFwIRsF1bZeNxWEh2NqU/JQ4vvYv09AcSJul88vna5T20+j0xLRr98Gorm jDEYWITDiTdsMe5zH+i30sptlk4hupa4z+T4fVb8zoLskD5x6Smts1TTT6ZIsIhj Lxltu5ZUSiRPwjd9h51sdxsc3w9a42g7KYrFPWc5ZSAo0fpFS+2W5QQARm9zu4BS rx111B3jqmMvuH45CMr7oSYqXcdhbjws2ZAcLiij2Aw4E0NRn4RIlvMvNYBhFXDD XSMQRn28UwjupJFZHMeYdg1DRc66NY+KIEL+IiXVUYyXm8PIFE2L0PdsSpg+St4n XjCm+zZrMA== =xrAM -----END PGP SIGNATURE----- --=-=-=--