emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/handler-bind-2 b21a22c86cc 13/16: Allow the `error-message` prop


From: Stefan Monnier
Subject: scratch/handler-bind-2 b21a22c86cc 13/16: Allow the `error-message` property to be a function
Date: Wed, 27 Dec 2023 23:53:31 -0500 (EST)

branch: scratch/handler-bind-2
commit b21a22c86cca6c1712a9473c1942316d266cdb75
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]