* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
@ 2019-05-25 19:47 Eli Zaretskii
2019-05-26 13:13 ` Amin Bandali
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2019-05-25 19:47 UTC (permalink / raw)
To: Eric S. Raymond; +Cc: emacs-devel
Eric,
This change must be documented in NEWS. I also think we should have
discussed such a significant change in behavior before pushing the
commit.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
2019-05-25 19:47 [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config Eli Zaretskii
@ 2019-05-26 13:13 ` Amin Bandali
2019-05-26 13:51 ` Stefan Monnier
0 siblings, 1 reply; 7+ messages in thread
From: Amin Bandali @ 2019-05-26 13:13 UTC (permalink / raw)
To: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> Eric,
>
> This change must be documented in NEWS. I also think we should have
> discussed such a significant change in behavior before pushing the
> commit.
>
> Thanks.
>
>
Seconded. Some comments about d68ed15:
- It hard-codes ~/.config, whereas the XDG Base Directory specification
specifies that $XDG_CONFIG_HOME should be consulted and if it’s not
set or if it’s empty then fall back to ~/.config. If we are doing
this, let’s try to do it properly from the start :)
- The convention for programs adhering to the spec is to keep their
files in a subdirectory of $XDG_CONFIG_HOME named after the program
itself. For instance, i3 would use $XDG_CONFIG_HOME/i3 and msmtp
would use $XDG_CONFIG_HOME/msmtp. So, I think it would be best for
Emacs to use $XDG_CONFIG_HOME/emacs instead of the proposed
$XDG_CONFIG_HOME/emacs.d, and put all emacs-related things in it. In
short, the paths would look like:
- ~/.emacs -> $XDG_CONFIG_HOME/emacs/emacsrc
- ~/.emacs.el -> $XDG_CONFIG_HOME/emacs/emacs.el
- ~/.emacs.d/init.el -> $XDG_CONFIG_HOME/emacs/init.el
I also suggest adjusting the custom-file examples to the following
respectively:
- $XDG_CONFIG_HOME/emacs/custom-21.el
- $XDG_CONFIG_HOME/emacs/custom-22.el
- $XDG_CONFIG_HOME/emacs/custom.el
The specification is available from [1], and the ArchWiki page [2]
provides a helpful summary, as well as a long list of programs
supporting the spec and links to their implementation commits.
[1]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html
[2]: https://wiki.archlinux.org/index.php/XDG_Base_Directory
Thanks for working on this.
-amin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
2019-05-26 13:13 ` Amin Bandali
@ 2019-05-26 13:51 ` Stefan Monnier
2019-05-26 14:49 ` Eli Zaretskii
2019-05-26 22:17 ` Amin Bandali
0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2019-05-26 13:51 UTC (permalink / raw)
To: emacs-devel
> - ~/.emacs -> $XDG_CONFIG_HOME/emacs/emacsrc
> - ~/.emacs.el -> $XDG_CONFIG_HOME/emacs/emacs.el
> - ~/.emacs.d/init.el -> $XDG_CONFIG_HOME/emacs/init.el
The first two don't make sense: those who use $XDG_CONFIG_HOME/emacs/
should just use init.el. There's no need for some kind of backward
compatibility here.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
2019-05-26 13:51 ` Stefan Monnier
@ 2019-05-26 14:49 ` Eli Zaretskii
2019-05-26 22:17 ` Amin Bandali
1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-05-26 14:49 UTC (permalink / raw)
To: Stefan Monnier; +Cc: esr, emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 26 May 2019 09:51:27 -0400
>
> > - ~/.emacs -> $XDG_CONFIG_HOME/emacs/emacsrc
> > - ~/.emacs.el -> $XDG_CONFIG_HOME/emacs/emacs.el
> > - ~/.emacs.d/init.el -> $XDG_CONFIG_HOME/emacs/init.el
>
> The first two don't make sense: those who use $XDG_CONFIG_HOME/emacs/
> should just use init.el. There's no need for some kind of backward
> compatibility here.
If enough people raise valid objections, and Eric doesn't respond, I
will revert the changeset.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
2019-05-26 13:51 ` Stefan Monnier
2019-05-26 14:49 ` Eli Zaretskii
@ 2019-05-26 22:17 ` Amin Bandali
1 sibling, 0 replies; 7+ messages in thread
From: Amin Bandali @ 2019-05-26 22:17 UTC (permalink / raw)
To: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> - ~/.emacs -> $XDG_CONFIG_HOME/emacs/emacsrc
>> - ~/.emacs.el -> $XDG_CONFIG_HOME/emacs/emacs.el
>> - ~/.emacs.d/init.el -> $XDG_CONFIG_HOME/emacs/init.el
>
> The first two don't make sense: those who use $XDG_CONFIG_HOME/emacs/
> should just use init.el. There's no need for some kind of backward
> compatibility here.
>
>
Thinking more about this, I agree. It makes much more sense to only
look for init.el inside $XDG_CONFIG_HOME/emacs/ since we’ll already have
a directory structure to organize things (including the init file) in,
and there’s no need to look for the first two cases for the new location
anymore.
>
> Stefan
>
>
>
Best,
amin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
[not found] ` <20190525172357.86D4F207F5@vcs0.savannah.gnu.org>
@ 2019-05-26 22:40 ` Stefan Monnier
2019-06-03 2:32 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2019-05-26 22:40 UTC (permalink / raw)
To: emacs-devel; +Cc: Eric S. Raymond
> -;;; startup.el --- process Emacs shell arguments -*- lexical-binding: t -*-
> +;; startup.el --- process Emacs shell arguments -*- lexical-binding: t -*-
This is an error, it should be 3 semi-colons.
> +(defun find-init-path (fn)
> + "Look in ~/.config/FOO or ~/.FOO for the dotfile or dot directory FOO.
> +It is expected that the output will undergo ~ expansion. Implements the
> +XDG convention for dotfiles."
> + (let* ((xdg-path (concat "~" init-file-user "/.config/" fn))
> + (oldstyle-path (concat "~" init-file-user "/." fn))
> + (found-path (if (file-exists-p xdg-path) xdg-path oldstyle-path)))
> + found-path))
AFAICT this is only used during startup and hence shouldn't have such
an "official sounding" name. It could/should use a "startup--" prefix,
for example.
Furthermore it shouldn't say "path" but "filename" to follow our
naming convention.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config.
2019-05-26 22:40 ` Stefan Monnier
@ 2019-06-03 2:32 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2019-06-03 2:32 UTC (permalink / raw)
To: Stefan Monnier; +Cc: esr, emacs-devel
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 26 May 2019 18:40:10 -0400
> Cc: "Eric S. Raymond" <esr@thyrsus.com>
>
> > -;;; startup.el --- process Emacs shell arguments -*- lexical-binding: t -*-
> > +;; startup.el --- process Emacs shell arguments -*- lexical-binding: t -*-
>
> This is an error, it should be 3 semi-colons.
>
> > +(defun find-init-path (fn)
> > + "Look in ~/.config/FOO or ~/.FOO for the dotfile or dot directory FOO.
> > +It is expected that the output will undergo ~ expansion. Implements the
> > +XDG convention for dotfiles."
> > + (let* ((xdg-path (concat "~" init-file-user "/.config/" fn))
> > + (oldstyle-path (concat "~" init-file-user "/." fn))
> > + (found-path (if (file-exists-p xdg-path) xdg-path oldstyle-path)))
> > + found-path))
>
> AFAICT this is only used during startup and hence shouldn't have such
> an "official sounding" name. It could/should use a "startup--" prefix,
> for example.
>
> Furthermore it shouldn't say "path" but "filename" to follow our
> naming convention.
No response in a week.
Would someone like to suggest changes to fix the problems in this
commit? If so, please show the proposed changes, and let's discuss
them. Failing that, I will revert that commit in a couple of days.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-06-03 2:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-25 19:47 [Emacs-diffs] master d68ed15: Implement and document XDG-style startup files under ~/.config Eli Zaretskii
2019-05-26 13:13 ` Amin Bandali
2019-05-26 13:51 ` Stefan Monnier
2019-05-26 14:49 ` Eli Zaretskii
2019-05-26 22:17 ` Amin Bandali
[not found] <20190525172356.30070.65317@vcs0.savannah.gnu.org>
[not found] ` <20190525172357.86D4F207F5@vcs0.savannah.gnu.org>
2019-05-26 22:40 ` Stefan Monnier
2019-06-03 2:32 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).