GNU bug report logs -
#45197
Saving customizations makes ~/.config/emacs/init (no .el extension)
Previous Next
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
View this message in rfc822 format
tsuucat <tsuucat <at> icloud.com> writes:
> (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".
Yes, I think the code here is just confused -- alt-file is "init" by
default, but since it's passed in as a closure, pretty much anything can
be returned, right? The code does the right thing in stripping the
".el" before passing it to `load', because then `load' will load
init.elc if it exists.
But we can't add back ".el" before setting init-file-name, because the
alt-file may legitimately be ".emacs", and should not then be forced to
".emacs.el".
So I think the "init" in the alt-file closure is the problem: It should
be "init.el", and init-file-name should be set to that verbatim. (But
the ".el" should still be stripped before doing the `load'.)
I think. I've now done this change in Emacs 28, but I'm not
super-confident about it -- there's many subtleties here...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 154 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.