emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XDG config dir [Was: Re: Default for image-dired-main-image-directory]


From: Alexandre Garreau
Subject: XDG config dir [Was: Re: Default for image-dired-main-image-directory]
Date: Wed, 27 Oct 2021 18:53:26 +0200

Le mercredi 27 octobre 2021, 15:42:11 CEST Ihor Radchenko a écrit :
> Eli Zaretskii <eliz@gnu.org> writes:
> >> >From a Emacs package perspective, just following XDG is still not
> >> >clear
> >> 
> >> enough.  Should all Emacs packages store data inside "XDG_DIR/emacs"
> >> subdirectory or maybe "XDG_DIR/emacs/package-name"? What should be
> >> the
> >> file names? The details I quoted are providing a possible
> >> clarification
> >> about these kinds of questions, except that no-littering assumes
> >> XDG_DIR=.emacs.d.
> > 
> > Look at xdg.el and at startup.el where we already use XDG-compliant
> > directories.  What you say above is neither compliant with XDG nor
> > with any current Emacs convention; it's an entirely new arrangement.
> > I think that's one too many.
> 
> What I propose is not an alternative to XDG. It is complient with XDG in
> a sense defined in "Referencing this specification" section of the XDG
> standard. We just put things under appropriate XDG_DIR instead of
> .emacs.d.

Oh btw that makes me think to something I always wondered: would there be 
a way to make so that to have .config/emacs instead of .emacs.d? at least 
when .config/xdg-something exists, for instance

That would reduce the clutter inside home directory, that’s partially 
solved by that xdg .config directory (although I find regrettable it’s not 
.local/etc, but a such symlink can solve that).

Btw there’s a whole bunch of directories autoconf computes at configuration 
time… where are these accessible from emacs lisp? shouldn’t emacs use the 
same naming convention for all of these? if they’re not accessible yet, 
maybe exposing them would be a good way to start…

Something like (std-dir 'user 'music) or (std-dir 'system 'icons) would be 
more complex than music-user-dir (and less consistent with already 
existing variables such as emacs-user-dir), but be useful in case a dir 
needs to be computed programmatically, for instance to do (std-dir 'user 
(case file-ext (("jpg" "png") 'picture) ("mkv" 'video) ("ogg" 'music))) 
instead of rewriting “-user-dir” each time (and imho allows greater 
flexibility since you could reuse the symbol to trigger something else 
before passing it to std-dir).

OTOH a such system couldn’t be searched with variable autocompletion, but 
on the other hand, given autocompletion/searching, the most useful naming 
scheme wouldn’t be a normal english name but something reversed like dir-
std-user-music or dir-std-system-icons, while a doc for std-dir could 
specify all of that comprehensively in just-one-place™ (but it would be a 
less standard way to search for a variable).

…although emacs supports autocompletion starting by the end or middle of a 
variable, so I don’t know, but I like the more complex system.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]