emacs-diffs
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]