GNU bug report logs -
#59334
29.0.50; loading native-compiled init file sets user-init-file to .eln
Previous Next
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
Message #35 received at 59334 <at> debbugs.gnu.org (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Fri, 18 Nov 2022 03:25:34 +0100
> Cc: Andrea Corallo <akrl <at> sdf.org>, 59334 <at> debbugs.gnu.org
>
> diff --git i/lisp/startup.el w/lisp/startup.el
> index 70267fc857..62984426e5 100644
> --- i/lisp/startup.el
> +++ w/lisp/startup.el
> @@ -1064,7 +1064,11 @@ startup--load-user-init-file
> ;; 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))
> + (when (member (file-name-extension user-init-file)
> + '("elc" "eln"))
> + (let* ((source (file-name-sans-extension
> + (or (gethash
> + (file-name-nondirectory user-init-file)
> + comp-eln-to-el-h)
> + user-init-file)))
> (alt (concat source ".el")))
> (setq source (cond ((file-exists-p alt) alt)
I think the call to gethash should only be done if the file has the
.eln extension, otherwise you might have false positives.
The logic should be something like
. if the extension is .eln then
- try to get the corresponding .el file by gethash
- if that fails, leave user-init-file to be the original .eln
file name, perhaps with a warning
- otherwise, set user-init-file to the .el file from gethash
. else <the original logic which yields .el or .elc>
The file-exists-and-is-newer test is not relevant to the .eln case,
because Emacs will not load a .eln file that is outdated wrt its
source, and will not use a .eln file whose source is not available.
Andrea, please correct me if I'm wrong.
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.