GNU bug report logs - #59334
29.0.50; loading native-compiled init file sets user-init-file to .eln

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Thu, 17 Nov 2022 09:30:02 UTC

Severity: normal

Fixed in version 29.0.50

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>, Andrea Corallo <akrl <at> sdf.org>
Cc: 59334 <at> debbugs.gnu.org
Subject: bug#59334: 29.0.50; loading native-compiled init file sets user-init-file to .eln
Date: Thu, 17 Nov 2022 16:00:11 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Thu, 17 Nov 2022 14:30:27 +0100
> Cc: 59334 <at> debbugs.gnu.org
> 
> M-: (gethash "init-7890dda9-d677a456.eln" comp-eln-to-el-h) RET
> 
> => "d:/mypath/Home/.emacs.d/init.el"

OK, thanks.  So using this, can you propose a patch for
startup--load-user-init-file, where it figures out the name of
user-init-file?  It happens in this fragment:

            ;; If we loaded a compiled file, set `user-init-file' to
            ;; the source version if that exists.
            (when (equal (file-name-extension user-init-file)
                         "elc")
              (let* ((source (file-name-sans-extension user-init-file))
                     (alt (concat source ".el")))
                (setq source (cond ((file-exists-p alt) alt)
                                   ((file-exists-p source) source)
                                   (t nil)))
                (when source
                  (when (file-newer-than-file-p source user-init-file)
                    (message "Warning: %s is newer than %s"
                             source user-init-file)
                    (sit-for 1))
                  (setq user-init-file source))))

Note that the gethash trick I suggested needs a _basename_ of the .eln
file, without any leading directories.

(It is best if you propose a patch because it should be easy for you
to test it.)

Andrea, do you agree with this solution?




This bug report was last modified 2 years and 244 days ago.

Previous Next


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