From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: Cleaning up and structuring user-emacs-directory Date: Wed, 19 Aug 2020 15:42:25 +0100 Message-ID: <14681895-d629-a291-6f02-fec95d1bdda8@harpegolden.net> References: <677E1813-9A0E-4127-9814-36CB9AB8B744@gmail.com> <871rk6uzbv.fsf@gnu.org> <87blj7jkg8.fsf@gnu.org> <20200819082835.GA31976@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17124"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 19 16:43:18 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 1k8PJ8-0004Ir-4B for ged-emacs-devel@m.gmane-mx.org; Wed, 19 Aug 2020 16:43:18 +0200 Original-Received: from localhost ([::1]:35836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8PJ7-0007AT-5M for ged-emacs-devel@m.gmane-mx.org; Wed, 19 Aug 2020 10:43:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8PIO-0005vh-1s for emacs-devel@gnu.org; Wed, 19 Aug 2020 10:42:32 -0400 Original-Received: from harpegolden.net ([65.99.215.13]:39736) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8PIM-0002o9-8P for emacs-devel@gnu.org; Wed, 19 Aug 2020 10:42:31 -0400 Original-Received: from [192.168.1.103] (87-198-55-78.ptr.magnet.ie [87.198.55.78]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA 4" (verified OK)) by harpegolden.net (Postfix) with ESMTPSA id E6E013C069 for ; Wed, 19 Aug 2020 14:42:27 +0000 (UTC) In-Reply-To: <20200819082835.GA31976@tuxteam.de> Content-Language: en-US Received-SPF: pass client-ip=65.99.215.13; envelope-from=david@harpegolden.net; helo=harpegolden.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/19 09:24:48 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:254012 Archived-At: 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 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 >