]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix problem with outputting error messages while dumping Emacs
authorGregory Heytings <gregory@heytings.org>
Mon, 4 Oct 2021 09:18:07 +0000 (11:18 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 4 Oct 2021 09:18:07 +0000 (11:18 +0200)
* src/print.c (print_error_message): Don't call
substitute-command-keys while bootstrapping.

src/print.c

index d4301fd7b6423539ea2ae768a82a03487d6e97e6..7f0bc3f364b331c96b75d6d3df4b80a4a125a97e 100644 (file)
@@ -941,7 +941,13 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
   else
     {
       Lisp_Object error_conditions = Fget (errname, Qerror_conditions);
-      errmsg = call1 (Qsubstitute_command_keys, Fget (errname, Qerror_message));
+      /* Calling `substitute-command-keys' while bootstrapping will make
+        Emacs exit, so don't do that.  */
+      if (will_bootstrap_p () || will_dump_p ())
+       errmsg = Fget (errname, Qerror_message);
+      else
+       errmsg = call1 (Qsubstitute_command_keys,
+                       Fget (errname, Qerror_message));
       file_error = Fmemq (Qfile_error, error_conditions);
     }