all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stefan@marxist.se, emacs-devel@gnu.org
Subject: Re: Default for image-dired-main-image-directory
Date: Tue, 26 Oct 2021 22:58:09 +0800	[thread overview]
Message-ID: <877ddzvnni.fsf@localhost> (raw)
In-Reply-To: <83wnlzyir1.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> Essentially, it is similar to XDG directory set, but all the directories
>> are inside .emacs.d by default.
>
> That's a different philosophy, and since it contradicts XDG, which
> many people want, I don't think we can go that way, except as an
> opt-in feature (which will then become a maintenance burden, as it
> will be yet another, third, set of defaults).

Not necessarily.  no-littering provides a unified directory structure to
be used by other packages. Yes, it defaults to structure inside .emacs.d
(and thus do not need to bother with OS-specific conventions), but
that's not required:

(defvar no-littering-etc-directory
  (expand-file-name (convert-standard-filename "etc/") user-emacs-directory)
  "The directory where packages place their configuration files.
This variable has to be set before `no-littering' is loaded.")

From point of view of a package author, I usually have difficulty
deciding where to put files. Package install dir? Directly into
.emacs.d? User home dir? I would prefer to have a convention about
default dirs. I would prefer Emacs to handle variations of directory
structure in different OS.

no-littering proposes a set of Emacs-specific conventions about where to
put package files:

>> (A) File names
>> 
>> File names are based on the name of the respective Emacs lisp variables
>> and the name of the respective Emacs package.
>> 
>> The name of the respective Emacs package should serve as the prefix of
>> the file name, unless the file is in a subdirectory in which case the
>> name of the subdirectory serves as the prefix.
>> 
>> If the name of the package and the prefix of the variable do not match,
>> then we prefer the name of the package.
>> 
>> If the name of a path variable ends with -file, -default-file,
>> -directory, -default-directory, or something similar, then that suffix
>> is usually dropped from the file name.
>> 
>> If applicable, the appropriate extension is added to the file name so
>> that files are visited using the appropriate major-modes and also to
>> provide a hint about the kind of data stored in the file. E.g. if a file
>> contains an S-expression, then the suffix should be *.el.
>> 
>> B) File location and subdirectories If a package has only one data file,
>> then that is usually placed in no-littering-var-directory itself.
>> Likewise if a package has only one config file, then that is placed in
>> no-littering-etc-directory itself.
>> 
>> If a package has multiple data (or config files), then those files are
>> placed in a subdirectory of no-littering-var-directory (or
>> no-littering-etc-directory).
>> 
>> If a subdirectory is used for a package's data (or config) file
>> variables, then the name of the directory should match the name of the
>> package in most cases. The subdirectory name may serve as the package
>> prefix of the file name.
>> 
>> If a package provides a "framework" for other packages to use, then we
>> may reuse its directories for other packages that make use of that
>> framework or otherwise "extend" the "main package". E.g. we place all
>> helm related files in helm/.
>> 
>> If a package only defines a single variable that specifies a data (or
>> config) directory, then the directory name should nevertheless be just
>> the package name. E.g. the path used for sx-cache-directory from the sx
>> package is sx/cache/, not sx-cache/.
>> 
>> However if the name of the directory variable implies that the package
>> won't ever define any data (or config) files that won't be placed in
>> that directory, then we use a top-level directory. E.g. when the name of
>> the variable is <package>-directory, in which case we would use just
>> <package>/ as the path.

Best,
Ihor



  parent reply	other threads:[~2021-10-26 14:58 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 13:14 master f8fed41 2/3: image-dired: Improve XDG compliance Eli Zaretskii
2021-10-25 16:14 ` Philip Kaludercic
2021-10-25 16:39   ` Eli Zaretskii
2021-10-25 17:52     ` Philip Kaludercic
2021-10-25 18:30       ` Eli Zaretskii
2021-10-26 10:24         ` Stefan Kangas
2021-10-26 13:09           ` Eli Zaretskii
2021-10-26 13:28             ` Stefan Kangas
2021-10-26 14:11               ` Eli Zaretskii
2021-10-26 14:35                 ` Stefan Kangas
2021-10-27  4:37                   ` Po Lu
2021-10-26 16:47         ` Philip Kaludercic
2021-10-26  2:07       ` Po Lu
2021-10-25 17:48   ` Stefan Monnier
2021-10-25 17:55     ` Philip Kaludercic
2021-10-25 17:58       ` Gregory Heytings
2021-10-25 18:04       ` Stefan Monnier
2021-10-26 10:25 ` Default for image-dired-main-image-directory Stefan Kangas
2021-10-26 13:12   ` Eli Zaretskii
2021-10-26 13:42     ` Ihor Radchenko
2021-10-26 14:15       ` Eli Zaretskii
2021-10-26 14:22         ` Stefan Kangas
2021-10-26 14:58         ` Ihor Radchenko [this message]
2021-10-26 16:15           ` Eli Zaretskii
2021-10-27 13:04             ` Ihor Radchenko
2021-10-27 13:26               ` Eli Zaretskii
2021-10-27 13:42                 ` Ihor Radchenko
2021-10-27 16:53                   ` XDG config dir [Was: Re: Default for image-dired-main-image-directory] Alexandre Garreau
2021-10-28  3:45                     ` Ihor Radchenko
2021-10-28  3:48                     ` Phil Sainty
2021-10-28  5:57                       ` Alexandre Garreau
2021-10-28  6:46                         ` Stefan Kangas
2021-10-26 14:14     ` Default for image-dired-main-image-directory Stefan Kangas
2021-10-26 15:37       ` Eli Zaretskii
2021-10-26 14:01 ` master f8fed41 2/3: image-dired: Improve XDG compliance Stefan Kangas
2021-10-26 14:19   ` Eli Zaretskii
2021-10-26 14:24     ` Stefan Kangas
2021-10-26 16:00       ` Eli Zaretskii
2021-10-26 16:13         ` Stefan Kangas
2021-10-26 16:21           ` Eli Zaretskii
2021-10-26 14:28   ` Eli Zaretskii
2021-10-26 14:45     ` Stefan Kangas
2021-10-26 16:12       ` Eli Zaretskii
2021-10-26 16:31         ` Eli Zaretskii
2021-10-26 19:17         ` Stefan Monnier
2021-10-26 19:28           ` Eli Zaretskii
2021-11-06  1:38           ` user-directory: New library to find user {conf,data,state,...} files Stefan Kangas
2021-11-06  1:52             ` Lars Ingebrigtsen
2021-11-06  2:56               ` user-directory: New library to find user {conf, data, state, ...} files Stefan Kangas
2021-11-06  3:11             ` Stefan Kangas
2021-11-07 19:31             ` Stefan Kangas
2021-11-07 19:52               ` Eli Zaretskii
2021-11-08  3:04                 ` Stefan Kangas
2021-11-08 12:19                   ` Eric S Fraga
2021-11-08 13:55                   ` Eli Zaretskii
2021-11-08 15:26                     ` Stefan Kangas
2021-11-08 18:31                       ` Eli Zaretskii
2021-11-09  7:05                         ` Stefan Kangas
2021-11-09 18:23                           ` Eli Zaretskii
2021-11-09 20:38                             ` Stefan Kangas
2021-11-11 10:34                               ` Eli Zaretskii
2021-11-08  3:35               ` Stefan Kangas
2021-11-08 15:40                 ` Stefan Kangas

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=877ddzvnni.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=stefan@marxist.se \
    /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.