summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-07-20 21:48:27 +0000
committerRichard M. Stallman <rms@gnu.org>2002-07-20 21:48:27 +0000
commit240e806c988420f9a0090ad3713341224f66b41a (patch)
tree4fb5945800de3a82ca24512b1fa94aa55226bc44 /src/print.c
parent8e40b6cbe93f1f2143c8d39509db4582a8709fef (diff)
downloademacs-240e806c988420f9a0090ad3713341224f66b41a.tar.gz
(print_error_message): New args CONTEXT and CALLER. Calls changed.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/print.c b/src/print.c
index 01f42ab0460..42dd0371469 100644
--- a/src/print.c
+++ b/src/print.c
@@ -920,7 +920,7 @@ DEFUN ("error-message-string", Ferror_message_string, Serror_message_string,
&& NILP (XCDR (XCDR (obj))))
return XCAR (XCDR (obj));
- print_error_message (obj, Vprin1_to_string_buffer);
+ print_error_message (obj, Vprin1_to_string_buffer, 0, Qnil);
set_buffer_internal (XBUFFER (Vprin1_to_string_buffer));
value = Fbuffer_string ();
@@ -937,13 +937,27 @@ DEFUN ("error-message-string", Ferror_message_string, Serror_message_string,
STREAM (suitable for the print functions). */
void
-print_error_message (data, stream)
+print_error_message (data, stream, context, caller)
Lisp_Object data, stream;
+ char *context;
+ Lisp_Object caller;
{
Lisp_Object errname, errmsg, file_error, tail;
struct gcpro gcpro1;
int i;
+ if (context != 0)
+ write_string_1 (context, -1, stream);
+
+ /* If we know from where the error was signaled, show it in
+ *Messages*. */
+ if (!NILP (caller) && SYMBOLP (caller))
+ {
+ const char *name = SDATA (SYMBOL_NAME (caller));
+ message_dolog (name, strlen (name), 0, 0);
+ message_dolog (": ", 2, 0, 0);
+ }
+
errname = Fcar (data);
if (EQ (errname, Qerror))