GNU bug report logs - #45197
Saving customizations makes ~/.config/emacs/init (no .el extension)

Previous Next

Package: emacs;

Reported by: tsuucat <tsuucat <at> icloud.com>

Date: Sat, 12 Dec 2020 18:20:01 UTC

Severity: normal

Tags: confirmed, fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #28 received at 45197 <at> debbugs.gnu.org (full text, mbox):

From: tsuucat <tsuucat <at> icloud.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 45197 <at> debbugs.gnu.org
Subject: Re: bug#45197: Saving customizations makes ~/.config/emacs/init (no
 .el extension)
Date: Wed, 16 Dec 2020 10:47:59 +0900
[Message part 1 (text/plain, inline)]
		  (unless init-file-name
		    (setq init-file-name alt-file))
is added
in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4118297ae2fab4886b20d193ba511a229637aea3.

Before this commit, I think ‘.emacs’ is always used  for ‘user-init-file’ value if
init file is missing.

                 (and (equal (file-name-extension alt-file) "el")
                      (setq alt-file (file-name-sans-extension alt-file)))
...
                 (load alt-file 'noerror 'nomessage)))

should be also changed in the commit to use “init.el” not “init".


> 2020/12/16 1:23、Eli Zaretskii <eliz <at> gnu.org>:
> 
>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Cc: tsuucat <at> icloud.com,  45197 <at> debbugs.gnu.org
>> Date: Tue, 15 Dec 2020 07:14:58 +0100
>> 
>> alternate-filename-function is the lambda up there, so it's
>> "/tmp/test-home/.config/emacs/init".  So this always sets user-init-file
>> to the .el-less file name.  (Well, it would have even if the alternate
>> file name had ended in ".el".)
>> 
>> That makes sense for making a file name for `load' (so that it'll load
>> the .elc file, if it exists), but setting `user-init-file' to that
>> .el-less name sounds like the problem here?
> 
> I'm not arguing against the fact that there's a bug, I'm just saying
> that there's code which was supposed to handle this, and I think
> that's where this should be fixed.


I can’t find such a code.

I made a patch to set 'user-init-file' value to init”.el" for XDG convention users 
who do not have an init file.

(But alternate-filename-function is only used for "init.el” so 
                  ...(if (equal (file-name-extension alt-file)
				 "el")
			    (file-name-sans-extension alt-file)
                          alt-file)...
may be redundant.)

--
tsuucat
[0001-Fix-user-init-file-value-when-file-is-missing-in-XDG.patch (application/octet-stream, attachment)]

This bug report was last modified 4 years and 155 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.