1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Be more resilient towards errors during error handling

* src/print.c (print_error_message): Avoid infinite recursion if
`substitute-command-keys' bugs out (bug#55269).

(cherry picked from commit 8364f058b8)
This commit is contained in:
Lars Ingebrigtsen 2022-05-05 13:22:33 +02:00 committed by Eli Zaretskii
parent 69c56cbe6e
commit 936009cfe5

View File

@ -944,7 +944,14 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context,
errmsg = Fget (errname, Qerror_message);
/* During loadup 'substitute-command-keys' might not be available. */
if (!NILP (Ffboundp (Qsubstitute_command_keys)))
errmsg = call1 (Qsubstitute_command_keys, errmsg);
{
/* `substitute-command-keys' may bug out, which would lead
to infinite recursion when we're called from
skip_debugger, so ignore errors. */
Lisp_Object subs = safe_call1 (Qsubstitute_command_keys, errmsg);
if (!NILP (subs))
errmsg = subs;
}
file_error = Fmemq (Qfile_error, error_conditions);
}