bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59334: 29.0.50; loading native-compiled init file sets user-init-fil


From: Andrea Corallo
Subject: bug#59334: 29.0.50; loading native-compiled init file sets user-init-file to .eln
Date: Thu, 17 Nov 2022 20:04:42 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Juanma Barranquero <lekktu@gmail.com>
>> Date: Thu, 17 Nov 2022 14:30:27 +0100
>> Cc: 59334@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?

Hi Eli,

yes, I'd have suggested the same.

  Andrea





reply via email to

[Prev in Thread] Current Thread [Next in Thread]