all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David De La Harpe Golden <david@harpegolden.net>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Cleaning up and structuring user-emacs-directory
Date: Wed, 19 Aug 2020 15:42:25 +0100	[thread overview]
Message-ID: <14681895-d629-a291-6f02-fec95d1bdda8@harpegolden.net> (raw)
In-Reply-To: <20200819082835.GA31976@tuxteam.de>

On 19/08/2020 09:28, tomas@tuxteam.de wrote:

> I've now read the freedesktop thing. If you ask me: please make that
> optional.

indeed, existing emacs fd.o support in various contexts is generally 
optional.

> I have none of those $XDG_* env vars set, and I have nothing
> of relevance in .local.
> 

They're overrides not mandatory, the normal circumstance for an app that 
follows the spec is falling back to the standard paths.  When emacs uses 
them, which it may already do in various circumstances, you can see it 
does that:

https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/xdg.el#n52

At startup, emacs apparently already uses  ~/.config/emacs/ if present 
and .emacs and ~/.emacs.d aren't:

https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el#n494

However, at time of writing a user using the existing emacs xdg 
~/.config/emacs/ dir  support will AFAICS actually find various arguably 
"data" and "cache" files also plonked into the "config" directory 
~/.config/emacs/ dir by emacs, as it's basically treated as an 
alternatively spelled ~/.emacs.d/

That may be consided at least vaguely suspect under the xdg spec 
conventions, user config, cache and data files are supposed to have 
those split locations.  To concretize, testing with emacs 27.1 
(personally I actually still use ~/.emacs and ~/.emacs.d/ normally!):


# keep for restoration!

$ mkdir -p .config/emacs/
$ cp .emacs .config/emacs/init.el
$ mv .emacs .emacs.off
$ mv .emacs.d .emacs.d.off


Run emacs

$ emacs

# intra-emacs do something arguably "cache" and "data" like getting the
# latest elpa package list and installing a package

M-x list-packages
<install something, trie for argument's sake>
C-x C-c


#  let's look inside:

ls ~/.config/emacs/


$ ls -1 ~/.config/emacs/
auto-save-list
elpa
init.el

$ ls -1 ~/.config/emacs/elpa/
archives
gnupg
heap-0.5
heap-0.5.signed
queue-0.2
queue-0.2.signed
tNFA-0.1.1
tNFA-0.1.1.signed
trie-0.4
trie-0.4.signed


# -> user ends up with emacs init.el in config (fine), but also
# elpa package lists stored in xdg config subdir not cache
# elpa packages installed in xdg config subdir not data

This contrasts to e.g. python's "pip install --user", as that will 
install python packages  ~/.local/lib/python3 etc. as "data", and keep 
its various transient metadata things in ~/.cache/pip/ as "cache"


















> Cheers
>   - t
> 




  parent reply	other threads:[~2020-08-19 14:42 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 19:30 A cache directory? Yuan Fu
2020-08-16 19:45 ` Yuri Khan
2020-08-16 20:43   ` Yuan Fu
2020-08-16 20:10 ` Cleaning up and structuring user-emacs-directory (was: A cache directory?) Amin Bandali
2020-08-18  4:06   ` Richard Stallman
2020-08-18  7:51   ` Cleaning up and structuring user-emacs-directory Gunnar Horrigmo
2020-08-18 22:41     ` Paul Eggert
2020-08-18  7:57   ` Gunnar Horrigmo
2020-08-19  4:01     ` Richard Stallman
2020-08-19  5:03       ` Amin Bandali
2020-08-19  8:28         ` tomas
2020-08-19 13:59           ` Amin Bandali
2020-08-19 14:18             ` tomas
2020-08-19 14:47               ` noah swainland
2020-08-19 14:42           ` David De La Harpe Golden [this message]
2020-08-19 16:14             ` tomas
2020-08-19 16:47               ` Yuan Fu
2020-08-19 17:33                 ` Stefan Monnier
2020-08-19 18:39                   ` Eli Zaretskii
2020-08-20  3:55                     ` Stefan Monnier
2020-08-20  7:08                       ` Andreas Schwab
2020-08-20 11:51                         ` Stefan Monnier
2020-08-19 13:33         ` Stefan Monnier
2020-08-19 14:15           ` tomas
2020-08-20  3:09         ` Richard Stallman
2020-08-20 14:56           ` Yuan Fu
2020-08-20 15:24             ` Stefan Monnier
2020-08-20 17:14               ` T.V Raman
2020-08-21  3:33               ` Richard Stallman
2020-08-23 15:15                 ` Stefan Monnier
2020-08-23 16:11                   ` Stefan Kangas
2020-08-23 19:02                   ` John Yates
2020-08-24  3:22                   ` Richard Stallman
2020-08-21  9:49         ` Gunnar Horrigmo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14681895-d629-a291-6f02-fec95d1bdda8@harpegolden.net \
    --to=david@harpegolden.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.