From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 45197@debbugs.gnu.org, tsuucat@icloud.com
Subject: bug#45197: Saving customizations makes ~/.config/emacs/init (no .el extension)
Date: Tue, 15 Dec 2020 07:14:58 +0100 [thread overview]
Message-ID: <87r1nr1tp9.fsf@gnus.org> (raw)
In-Reply-To: <83wnxkb7gn.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 14 Dec 2020 19:52:56 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
>> I did not read those 150 messages, and this code is uncommented in
>> startup.el:
>>
>> (lambda ()
>> (expand-file-name
>> "init"
>> startup-init-directory))
>>
>> Does anybody know whether this is just a typo?
>
> It isn't: the code later tries appending .el to the name.
The code flow isn't trivial to follow here, but this is the code:
(when (and (eq user-init-file t) alternate-filename-function)
(let ((alt-file (funcall alternate-filename-function)))
(and (equal (file-name-extension alt-file) "el")
(setq alt-file (file-name-sans-extension alt-file)))
(unless init-file-name
(setq init-file-name alt-file))
(load alt-file 'noerror 'nomessage)))
;; If we did not find the user's init file, set
;; user-init-file conclusively. Don't let it be
;; set from default.el.
(when (eq user-init-file t)
(setq user-init-file init-file-name)))
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?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2020-12-15 6:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-12 18:10 bug#45197: Saving customizations makes ~/.config/emacs/init (no .el extension) tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-14 17:11 ` Lars Ingebrigtsen
2020-12-14 17:23 ` Robert Pluim
2020-12-14 17:46 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-14 17:52 ` Eli Zaretskii
2020-12-15 6:14 ` Lars Ingebrigtsen [this message]
2020-12-15 16:23 ` Eli Zaretskii
2020-12-16 1:47 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-12-17 11:18 ` Lars Ingebrigtsen
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=87r1nr1tp9.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=45197@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=tsuucat@icloud.com \
/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.