]> git.eshelyaron.com Git - emacs.git/commitdiff
Be more resilient towards errors during error handling
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 5 May 2022 11:22:33 +0000 (13:22 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 5 May 2022 11:22:42 +0000 (13:22 +0200)
* src/print.c (print_error_message): Avoid infinite recursion if
`substitute-command-keys' bugs out (bug#55269).

src/print.c

index 54d8bdfa3d8d98803b81ab83bca4c846150d1a39..d7583282b69b4c8e1a78761669ab42c77679350b 100644 (file)
@@ -954,7 +954,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);
     }