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


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 45197 <at> debbugs.gnu.org, tsuucat <at> icloud.com
Subject: bug#45197: Saving customizations makes ~/.config/emacs/init (no .el extension)
Date: Tue, 15 Dec 2020 07:14:58 +0100
Eli Zaretskii <eliz <at> 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




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.