emacs-devel
[Top][All Lists]
Advanced

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

Re: master f8fed41 2/3: image-dired: Improve XDG compliance


From: Eli Zaretskii
Subject: Re: master f8fed41 2/3: image-dired: Improve XDG compliance
Date: Mon, 25 Oct 2021 16:14:24 +0300

I can't say I'm happy with creeping of XDG specifics into our
application code.  It's too platform-specific, so it gets in the way
of either adhering to platform-specific directories on each platform,
or having completely platform-independent identical directories on all
platforms.  Both of these alternatives could be useful, but XDG
provides neither: it only caters to a single platform, and leaves the
rest to manual coding.  Here's the result:

  (defcustom image-dired-main-image-directory
    (or (xdg-user-dir "PICTURES") "~/pics/")

Why "~/pics/"?  What platform behaves like that?  Probably none.

XDG is also prone to fashion changes.  What will we do when it goes
out of fashion, and we have dozens of xdg-user-dir calls in our
application code? change all of them to some latest desktop fashion?

To me, xdg.el was supposed to be a platform-specific layer on which to
base platform-independent abstractions.  Those abstractions should
have other platform-specific layers for other platforms, and the
abstractions should then be used in application code.  So when
fashions change on this or that platform, we need to change only the
code that implements the abstractions.  Our handling of XDG in
startup.el to find the user's Emacs home directory fits this
description; code like the above does not.

Can we agree not to use xdg.el in application code, and instead
develop those abstractions and start using them?  For example, how
about having a function user-pics-directory, which will return the
appropriate file name for the underlying platform?  Doing that will
not diminish our support for XDG (as long as it lasts), but will allow
us to have application code XDG-clean, so to speak.

OK?



reply via email to

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