unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59358@debbugs.gnu.org
Subject: bug#59358: 29.0.50; failing to load .eln for init file sets user-init-file to warnings.el
Date: Sat, 19 Nov 2022 10:13:58 +0100	[thread overview]
Message-ID: <CAAeL0SR0HQkBdqhYRsvuTW5eH5xC=gXxX7XEyZJV0fdEcaOcKQ@mail.gmail.com> (raw)
In-Reply-To: <834juwbasq.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

On Fri, Nov 18, 2022 at 3:24 PM Eli Zaretskii <eliz@gnu.org> wrote:


> That is a separate bug, IMO.  Is this because in Fload we set 'found'
> to the file name of warnings.el/.eln in this case?  If so, we should
> prevent this nonsense.
>

The bug is the consequence of maybe_swap_for_eln calling `display-warning',
which initiates a recursive Fload while user-init-file is still t, so Fload
"records" the current file name.

The easiest fix in my view is to use delayed warnings and avoid the
recursive Fload.

diff --git i/src/lread.c w/src/lread.c
index c28324dc35..2a57f72194 100644
--- i/src/lread.c
+++ w/src/lread.c
@@ -1742,10 +1742,13 @@ maybe_swap_for_eln (bool no_native, Lisp_Object
*filename, int *fd,
                                               Qnil, Qnil)))
                return;
-             call2 (intern_c_string ("display-warning"),
-                    Qcomp,
-                    CALLN (Fformat,
-                           build_string ("Cannot look up eln file as "
-                                         "no source file was found for
%s"),
-                           *filename));
+             Vdelayed_warnings_list
+               = Fcons (list2
+                        (Qcomp,
+                         CALLN (Fformat,
+                                build_string ("Cannot look up eln "
+                                              "file as no source file "
+                                              "was found for %s"),
+                                *filename)),
+                        Vdelayed_warnings_list);
              return;
            }

[-- Attachment #2: Type: text/html, Size: 2735 bytes --]

  reply	other threads:[~2022-11-19  9:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 13:17 bug#59358: 29.0.50; failing to load .eln for init file sets user-init-file to warnings.el Juanma Barranquero
2022-11-18 14:24 ` Eli Zaretskii
2022-11-19  9:13   ` Juanma Barranquero [this message]
2022-11-19 10:21     ` Eli Zaretskii
2022-11-20 18:59       ` Andrea Corallo
2022-11-27 19:01   ` bug#59424: " Juanma Barranquero
2022-11-27 19:26     ` Eli Zaretskii
2022-11-27 19:53       ` Juanma Barranquero
2022-11-27 20:26         ` Eli Zaretskii
2022-11-27 20:29           ` Juanma Barranquero
2022-11-28 13:58           ` Andrea Corallo
2022-11-20 22:14 ` bug#59358: Juanma Barranquero

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAeL0SR0HQkBdqhYRsvuTW5eH5xC=gXxX7XEyZJV0fdEcaOcKQ@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=59358@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).