diff options
| author | Lars Ingebrigtsen | 2022-05-05 13:22:33 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-05-05 20:05:28 +0300 |
| commit | 936009cfe53623c2e9fdb8f25b859600ac4dca67 (patch) | |
| tree | 1280b4496e40174d9796113402cab8117326c31b /src | |
| parent | 69c56cbe6ed56024440203181dda2d6fee6dc9f4 (diff) | |
| download | emacs-936009cfe53623c2e9fdb8f25b859600ac4dca67.tar.gz emacs-936009cfe53623c2e9fdb8f25b859600ac4dca67.zip | |
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 8364f058b821eba31f84dcded175cca403a965a5)
Diffstat (limited to 'src')
| -rw-r--r-- | src/print.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/print.c b/src/print.c index 3a26e5665e5..43ec0934ba1 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -944,7 +944,14 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, | |||
| 944 | errmsg = Fget (errname, Qerror_message); | 944 | errmsg = Fget (errname, Qerror_message); |
| 945 | /* During loadup 'substitute-command-keys' might not be available. */ | 945 | /* During loadup 'substitute-command-keys' might not be available. */ |
| 946 | if (!NILP (Ffboundp (Qsubstitute_command_keys))) | 946 | if (!NILP (Ffboundp (Qsubstitute_command_keys))) |
| 947 | errmsg = call1 (Qsubstitute_command_keys, errmsg); | 947 | { |
| 948 | /* `substitute-command-keys' may bug out, which would lead | ||
| 949 | to infinite recursion when we're called from | ||
| 950 | skip_debugger, so ignore errors. */ | ||
| 951 | Lisp_Object subs = safe_call1 (Qsubstitute_command_keys, errmsg); | ||
| 952 | if (!NILP (subs)) | ||
| 953 | errmsg = subs; | ||
| 954 | } | ||
| 948 | 955 | ||
| 949 | file_error = Fmemq (Qfile_error, error_conditions); | 956 | file_error = Fmemq (Qfile_error, error_conditions); |
| 950 | } | 957 | } |