all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juanma Barranquero <lekktu@gmail.com>, Andrea Corallo <akrl@sdf.org>
Cc: 59334@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	[thread overview]
Message-ID: <83wn7td6l0.fsf@gnu.org> (raw)
In-Reply-To: <CAAeL0SSKo9dPgL9rhPDVU6BPX0j9gvp8SiZnZvDp6BCiw8nwCQ@mail.gmail.com> (message from Juanma Barranquero on Thu, 17 Nov 2022 14:30:27 +0100)

> 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?





  reply	other threads:[~2022-11-17 14:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  9:28 bug#59334: 29.0.50; loading native-compiled init file sets user-init-file to .eln Juanma Barranquero
2022-11-17 12:07 ` Eli Zaretskii
2022-11-17 13:30   ` Juanma Barranquero
2022-11-17 14:00     ` Eli Zaretskii [this message]
2022-11-17 20:04       ` Andrea Corallo
2022-11-17 20:09         ` Eli Zaretskii
2022-11-18  2:25           ` Juanma Barranquero
2022-11-18  2:56             ` Juanma Barranquero
2022-11-18  3:03               ` Juanma Barranquero
2022-11-18  7:50                 ` Eli Zaretskii
2022-11-18  7:19             ` Eli Zaretskii
2022-11-18  7:27             ` Eli Zaretskii
2022-11-18  7:45               ` Juanma Barranquero
2022-11-18  8:46                 ` Eli Zaretskii
2022-11-18  9:05                   ` Juanma Barranquero
2022-11-18  9:08                     ` Juanma Barranquero
2022-11-18 12:33                     ` Eli Zaretskii
2022-11-18 12:40                       ` Juanma Barranquero
2022-11-18 12:50                         ` Eli Zaretskii
2022-11-18 13:03                           ` Juanma Barranquero
2022-11-18 20:02                       ` Andrea Corallo
2022-11-18 10:39                   ` Andrea Corallo

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=83wn7td6l0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59334@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=lekktu@gmail.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.