all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: acm@muc.de, Eli Zaretskii <eliz@gnu.org>, 58224@debbugs.gnu.org
Subject: bug#58224: 29.0.50; "make bootstrap" spuriously warns: "comp.el newer than byte-compiled file"
Date: Sat, 1 Oct 2022 21:15:46 +0000	[thread overview]
Message-ID: <YziuAkFkqtHtu+HZ@ACM> (raw)
In-Reply-To: <YziC2mhnc7BtreCZ@ACM>

Hello again, Stefan.

I've hacked a quick fix together.  The idea is to give the variable
force-load-messages an extra possibility, 'never.  This suppresses the
messages we want to suppress.

No guarantees, but the patch is below, if you want to try it out.

On Sat, Oct 01, 2022 at 18:11:38 +0000, Alan Mackenzie wrote:
> Hello, Stefan.

> On Sat, Oct 01, 2022 at 18:10:19 +0200, Stefan Kangas wrote:
> > Eli Zaretskii <eliz@gnu.org> writes:

> > > (This has nothing to do with what Lars did, it's due to changes by
> > > Alan to speedup the first stage of the bootstrap.)

> > Oh, right.  I forgot about that.

> > I'm copying in Alan, in case he has any comments.

> Well, my thoughts back when implementing that speedup were that the
> speedup was more important than a few irritating messages.  I suppose
> that's becomng less true as the long delays from the past fade from
> memory.

> The particular message about "<file> newer than byte-compile file; using
> older file" is hard-coded into Fload in src/lread.c.  It was considered
> important enough to supersede the flag variable force-load-messages.  It
> also supersedes the parameter NOMESSAGE to Fload.

> I don't know why this message is considered so important.  Maybe we
> might reconsider its importance.  But there are already two flag
> variables meant to control messages from Fload, so adding a third
> special one probably wouldn't be a good idea.

> This doesn't seem like an easy issue to resolve without nasty special
> case code.  Either that, or we reconsider the mechanism of making the
> ..elc files older to trigger make's recompiling of the .el files to .eln.
> Maybe there's a better way of doing that.



diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index bcf4a3146d..8065487f59 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -70,7 +70,8 @@ BYTE_COMPILE_FLAGS =
   --eval "(setq load-prefer-newer t byte-compile-warnings 'all)" \
 	$(BYTE_COMPILE_EXTRA_FLAGS)
 # ... but we must prefer .elc files for those in the early bootstrap.
-compile-first: BYTE_COMPILE_FLAGS = $(BYTE_COMPILE_EXTRA_FLAGS)
+compile-first: BYTE_COMPILE_FLAGS = \
+  --eval "(setq force-load-messages 'never)" $(BYTE_COMPILE_EXTRA_FLAGS)
 
 # Files to compile before others during a bootstrap.  This is done to
 # speed up the bootstrap process.  They're ordered by size, so we use
diff --git a/src/lread.c b/src/lread.c
index 51cbf811ba..1ae0f9c0cc 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1451,7 +1451,9 @@ Return t if the file exists and loads successfully.  */)
                   newer = 1;
 
                   /* If we won't print another message, mention this anyway.  */
-                  if (!NILP (nomessage) && !force_load_messages)
+                  if (!NILP (nomessage) &&
+		      (NILP (Vforce_load_messages)
+		       || !EQ (Vforce_load_messages, Qnever)))
                     {
                       Lisp_Object msg_file;
                       msg_file = Fsubstring (found, make_fixnum (0), make_fixnum (-1));
@@ -1476,7 +1478,9 @@ Return t if the file exists and loads successfully.  */)
 	    }
 	  val = call4 (Vload_source_file_function, found, hist_file_name,
 		       NILP (noerror) ? Qnil : Qt,
-		       (NILP (nomessage) || force_load_messages) ? Qnil : Qt);
+		       (NILP (nomessage) ||
+			(!NILP (Vforce_load_messages) && !EQ (Vforce_load_messages, Qnever)))
+		       ? Qnil : Qt);
 	  return unbind_to (count, val);
 	}
     }
@@ -1529,7 +1533,8 @@ Return t if the file exists and loads successfully.  */)
   if (! NILP (Vpurify_flag))
     Vpreloaded_file_list = Fcons (Fpurecopy (file), Vpreloaded_file_list);
 
-  if (NILP (nomessage) || force_load_messages)
+  if (NILP (nomessage)
+      || (!NILP (Vforce_load_messages) && !EQ (Vforce_load_messages, Qnever)))
     {
       if (is_module)
         message_with_string ("Loading %s (module)...", file, 1);
@@ -1602,7 +1607,9 @@ Return t if the file exists and loads successfully.  */)
       saved_strings[i].size = 0;
     }
 
-  if (!noninteractive && (NILP (nomessage) || force_load_messages))
+  if (!noninteractive && (NILP (nomessage)
+			  || (!NILP (Vforce_load_messages)
+			      && !EQ (Vforce_load_messages, Qnever))))
     {
       if (is_module)
         message_with_string ("Loading %s (module)...done", file, 1);
@@ -5601,10 +5608,13 @@ incompatible byte codes can make Emacs crash when it tries to execute
 them.  */);
   load_dangerous_libraries = 0;
 
-  DEFVAR_BOOL ("force-load-messages", force_load_messages,
-	       doc: /* Non-nil means force printing messages when loading Lisp files.
+  DEFVAR_LISP ("force-load-messages", Vforce_load_messages,
+	       doc: /* t means force printing messages when loading Lisp files.
+`never' means suppress all messages when loading Lisp files.  nil means just print
+certain "important" messages.
+
 This overrides the value of the NOMESSAGE argument to `load'.  */);
-  force_load_messages = 0;
+  Vforce_load_messages = Qnil;
 
   DEFVAR_LISP ("bytecomp-version-regexp", Vbytecomp_version_regexp,
 	       doc: /* Regular expression matching safe to load compiled Lisp files.
@@ -5685,6 +5695,8 @@ that are loaded before your customizations are read!  */);
   DEFSYM (Qdir_ok, "dir-ok");
   DEFSYM (Qdo_after_load_evaluation, "do-after-load-evaluation");
 
+  DEFSYM (Qnever, "never");
+
   staticpro (&read_objects_map);
   read_objects_map = Qnil;
   staticpro (&read_objects_completed);


-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2022-10-01 21:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-01 14:15 bug#58224: 29.0.50; "make bootstrap" spuriously warns: "comp.el newer than byte-compiled file" Stefan Kangas
2022-10-01 14:29 ` Lars Ingebrigtsen
2022-10-01 14:50 ` Eli Zaretskii
2022-10-01 16:10   ` Stefan Kangas
2022-10-01 18:11     ` Alan Mackenzie
2022-10-01 21:15       ` Alan Mackenzie [this message]
2022-10-02  5:59         ` Eli Zaretskii
2022-10-02 10:43           ` Alan Mackenzie
2022-10-02 11:04             ` Eli Zaretskii
2022-10-02 11:32               ` Alan Mackenzie
2022-10-02 15:38               ` Alan Mackenzie
2022-10-02 15:54                 ` Eli Zaretskii
2022-10-02 16:46                   ` Alan Mackenzie
2022-10-02 17:07                     ` Eli Zaretskii
2022-10-02 20:37                       ` Alan Mackenzie
2022-10-02 21:29                         ` Stefan Kangas

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=YziuAkFkqtHtu+HZ@ACM \
    --to=acm@muc.de \
    --cc=58224@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=stefankangas@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.