diff options
| author | Paul Eggert | 2012-05-25 11:19:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-05-25 11:19:24 -0700 |
| commit | 42b2a986d9d4b7040fb20c90ec0efeffb78e761a (patch) | |
| tree | d38e7bf5307837f2f38982757f088100de18a64e /src/print.c | |
| parent | e4d81efc58695c19154d5f6733d91172b4c3e5b7 (diff) | |
| parent | a8d3cbf75d219d7a249fc0623219511179e959da (diff) | |
| download | emacs-42b2a986d9d4b7040fb20c90ec0efeffb78e761a.tar.gz emacs-42b2a986d9d4b7040fb20c90ec0efeffb78e761a.zip | |
Merge from trunk.
Diffstat (limited to 'src/print.c')
| -rw-r--r-- | src/print.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/print.c b/src/print.c index bfe3287b92c..2912396bd33 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -854,7 +854,6 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, | |||
| 854 | { | 854 | { |
| 855 | Lisp_Object errname, errmsg, file_error, tail; | 855 | Lisp_Object errname, errmsg, file_error, tail; |
| 856 | struct gcpro gcpro1; | 856 | struct gcpro gcpro1; |
| 857 | int i; | ||
| 858 | 857 | ||
| 859 | if (context != 0) | 858 | if (context != 0) |
| 860 | write_string_1 (context, -1, stream); | 859 | write_string_1 (context, -1, stream); |
| @@ -885,9 +884,8 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, | |||
| 885 | } | 884 | } |
| 886 | else | 885 | else |
| 887 | { | 886 | { |
| 888 | Lisp_Object error_conditions; | 887 | Lisp_Object error_conditions = Fget (errname, Qerror_conditions); |
| 889 | errmsg = Fget (errname, Qerror_message); | 888 | errmsg = Fget (errname, Qerror_message); |
| 890 | error_conditions = Fget (errname, Qerror_conditions); | ||
| 891 | file_error = Fmemq (Qfile_error, error_conditions); | 889 | file_error = Fmemq (Qfile_error, error_conditions); |
| 892 | } | 890 | } |
| 893 | 891 | ||
| @@ -901,22 +899,30 @@ print_error_message (Lisp_Object data, Lisp_Object stream, const char *context, | |||
| 901 | if (!NILP (file_error) && CONSP (tail)) | 899 | if (!NILP (file_error) && CONSP (tail)) |
| 902 | errmsg = XCAR (tail), tail = XCDR (tail); | 900 | errmsg = XCAR (tail), tail = XCDR (tail); |
| 903 | 901 | ||
| 904 | if (STRINGP (errmsg)) | 902 | { |
| 905 | Fprinc (errmsg, stream); | 903 | const char *sep = ": "; |
| 906 | else | ||
| 907 | write_string_1 ("peculiar error", -1, stream); | ||
| 908 | 904 | ||
| 909 | for (i = 0; CONSP (tail); tail = XCDR (tail), i = 1) | 905 | if (!STRINGP (errmsg)) |
| 910 | { | 906 | write_string_1 ("peculiar error", -1, stream); |
| 911 | Lisp_Object obj; | 907 | else if (SCHARS (errmsg)) |
| 908 | Fprinc (errmsg, stream); | ||
| 909 | else | ||
| 910 | sep = NULL; | ||
| 912 | 911 | ||
| 913 | write_string_1 (i ? ", " : ": ", 2, stream); | 912 | for (; CONSP (tail); tail = XCDR (tail), sep = ", ") |
| 914 | obj = XCAR (tail); | 913 | { |
| 915 | if (!NILP (file_error) || EQ (errname, Qend_of_file)) | 914 | Lisp_Object obj; |
| 916 | Fprinc (obj, stream); | 915 | |
| 917 | else | 916 | if (sep) |
| 918 | Fprin1 (obj, stream); | 917 | write_string_1 (sep, 2, stream); |
| 919 | } | 918 | obj = XCAR (tail); |
| 919 | if (!NILP (file_error) | ||
| 920 | || EQ (errname, Qend_of_file) || EQ (errname, Quser_error)) | ||
| 921 | Fprinc (obj, stream); | ||
| 922 | else | ||
| 923 | Fprin1 (obj, stream); | ||
| 924 | } | ||
| 925 | } | ||
| 920 | 926 | ||
| 921 | UNGCPRO; | 927 | UNGCPRO; |
| 922 | } | 928 | } |