[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/handler-bind 1fcb76b0465 08/12: Allow the `error-message` proper
From: |
Stefan Monnier |
Subject: |
scratch/handler-bind 1fcb76b0465 08/12: Allow the `error-message` property to be a function |
Date: |
Mon, 25 Dec 2023 23:56:51 -0500 (EST) |
branch: scratch/handler-bind
commit 1fcb76b0465f7909596f2aa18361238f369c6417
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Allow the `error-message` property to be a function
---
src/print.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/print.c b/src/print.c
index 96c4d0a5d1e..79a992bef81 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1089,7 +1089,12 @@ print_error_message (Lisp_Object data, Lisp_Object
stream, const char *context,
Lisp_Object error_conditions = Fget (errname, Qerror_conditions);
errmsg = Fget (errname, Qerror_message);
/* During loadup 'substitute-command-keys' might not be available. */
- if (!NILP (Ffboundp (Qsubstitute_command_keys)))
+ if (FUNCTIONP (errmsg))
+ {
+ call2 (errmsg, data, stream);
+ return;
+ }
+ else if (!NILP (Ffboundp (Qsubstitute_command_keys)))
{
/* `substitute-command-keys' may bug out, which would lead
to infinite recursion when we're called from
- branch scratch/handler-bind created (now 933bc573c60), Stefan Monnier, 2023/12/25
- scratch/handler-bind 23479891db8 01/12: New special form `handler-bind`, Stefan Monnier, 2023/12/25
- scratch/handler-bind 7da237eb092 03/12: edebug.el: Use `handler-bind` instead of `signal-hook-function`, Stefan Monnier, 2023/12/25
- scratch/handler-bind 089c87c61db 02/12: (eval-expression): Fix bug#67196, Stefan Monnier, 2023/12/25
- scratch/handler-bind a97a2363e39 04/12: ert.el: Use `handler-bind` to record backtraces, Stefan Monnier, 2023/12/25
- scratch/handler-bind 8f090cd421d 05/12: tramp.el: Use `handler-bind` instead of `signal-hook-function`, Stefan Monnier, 2023/12/25
- scratch/handler-bind 2f6f38ddc79 07/12: Move batch backtrace code to `top_level_2`, Stefan Monnier, 2023/12/25
- scratch/handler-bind e7c19f33112 09/12: (edebug-format): Make it obsolete, Stefan Monnier, 2023/12/25
- scratch/handler-bind 071ea552e6b 10/12: Add `redisplay-counter` to catched nested redisplays and abort outer one, Stefan Monnier, 2023/12/25
- scratch/handler-bind 68c95fc6682 06/12: startup.el: Use `handler-bind` to implement `--debug-init`, Stefan Monnier, 2023/12/25
- scratch/handler-bind 1fcb76b0465 08/12: Allow the `error-message` property to be a function,
Stefan Monnier <=
- scratch/handler-bind 453f977d642 11/12: misc debug-early.el (incl. debug-early-muted), Stefan Monnier, 2023/12/25
- scratch/handler-bind 933bc573c60 12/12: (macroexp--with-extended-form-stack): Use plain `let`, Stefan Monnier, 2023/12/25