From 1428962590e216163f079ff838f39667383aec56 Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Mon, 4 Oct 2021 11:18:07 +0200 Subject: [PATCH] Fix problem with outputting error messages while dumping Emacs * src/print.c (print_error_message): Don't call substitute-command-keys while bootstrapping. --- src/print.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/print.c b/src/print.c index d4301fd7b64..7f0bc3f364b 100644 --- a/src/print.c +++ b/src/print.c @@ -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); } -- 2.39.5