Mercurial > hg > xemacs-beta
comparison src/data.c @ 563:183866b06e0b
[xemacs-hg @ 2001-05-24 07:50:48 by ben]
Makefile.in.in, abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, casetab.c, chartab.c, cmdloop.c, cmds.c, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console.c, data.c, database.c, debug.c, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, dired.c, doc.c, doprnt.c, dragdrop.c, editfns.c, eldap.c, eldap.h, elhash.c, emacs-widget-accessors.c, emacs.c, emodules.c, esd.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, filelock.c, floatfns.c, fns.c, font-lock.c, frame-gtk.c, frame-x.c, frame.c, general-slots.h, glade.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-gtk.c, gui-x.c, gui.c, gutter.c, hpplay.c, indent.c, input-method-xlib.c, insdel.c, intl.c, keymap.c, libsst.c, libsst.h, linuxplay.c, lisp.h, lread.c, lstream.c, lstream.h, macros.c, marker.c, md5.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, miscplay.c, miscplay.h, mule-ccl.c, mule-charset.c, mule-wnnfns.c, mule.c, nas.c, ntplay.c, ntproc.c, objects-gtk.c, objects-msw.c, objects-x.c, objects.c, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, ralloc.c, rangetab.c, redisplay.c, scrollbar.c, search.c, select-gtk.c, select-x.c, select.c, sgiplay.c, sheap.c, sound.c, specifier.c, sunplay.c, symbols.c, symeval.h, symsinit.h, syntax.c, sysdep.c, toolbar-msw.c, toolbar.c, tooltalk.c, ui-byhand.c, ui-gtk.c, undo.c, unexaix.c, unexapollo.c, unexconvex.c, unexec.c, widget.c, win32.c, window.c:
-- defsymbol -> DEFSYMBOL.
-- add an error type to all errors.
-- eliminate the error functions in eval.c that let you just
use Qerror as the type.
-- redo the error API to be more consistent, sensibly named,
and easier to use.
-- redo the error hierarchy somewhat. create new errors:
structure-formation-error, gui-error, invalid-constant,
stack-overflow, out-of-memory, process-error, network-error,
sound-error, printing-unreadable-object, base64-conversion-
error; coding-system-error renamed to text-conversion error;
some others.
-- fix Mule problems in error strings in emodules.c, tooltalk.c.
-- fix error handling in mswin open-network-stream.
-- Mule-ize all sound files and clean up the headers.
-- nativesound.h -> sound.h and used for all sound files.
-- move some shared stuff into glyphs-shared.c: first attempt
at eliminating some of the massive GTK code duplication.
xemacs.mak: add glyphs-shared.c.
xemacs-faq.texi: document how to debug X errors
subr.el: fix doc string to reflect reality
author | ben |
---|---|
date | Thu, 24 May 2001 07:51:33 +0000 |
parents | c33ae14dd6d0 |
children | 55e998c311f5 |
comparison
equal
deleted
inserted
replaced
562:c775bd016b32 | 563:183866b06e0b |
---|---|
1 /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. | 1 /* Primitive operations on Lisp data types for XEmacs Lisp interpreter. |
2 Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 | 2 Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 Copyright (C) 2000 Ben Wing. | 4 Copyright (C) 2000, 2001 Ben Wing. |
5 | 5 |
6 This file is part of XEmacs. | 6 This file is part of XEmacs. |
7 | 7 |
8 XEmacs is free software; you can redistribute it and/or modify it | 8 XEmacs is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | 9 under the terms of the GNU General Public License as published by the |
39 #endif /* LISP_FLOAT_TYPE */ | 39 #endif /* LISP_FLOAT_TYPE */ |
40 | 40 |
41 Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; | 41 Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound; |
42 Lisp_Object Qerror_conditions, Qerror_message; | 42 Lisp_Object Qerror_conditions, Qerror_message; |
43 Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; | 43 Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax; |
44 Lisp_Object Qlist_formation_error; | 44 Lisp_Object Qlist_formation_error, Qstructure_formation_error; |
45 Lisp_Object Qmalformed_list, Qmalformed_property_list; | 45 Lisp_Object Qmalformed_list, Qmalformed_property_list; |
46 Lisp_Object Qcircular_list, Qcircular_property_list; | 46 Lisp_Object Qcircular_list, Qcircular_property_list; |
47 Lisp_Object Qinvalid_argument, Qwrong_type_argument, Qargs_out_of_range; | 47 Lisp_Object Qinvalid_argument, Qinvalid_constant, Qwrong_type_argument; |
48 Lisp_Object Qargs_out_of_range; | |
48 Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch; | 49 Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch; |
49 Lisp_Object Qinternal_error, Qinvalid_state; | 50 Lisp_Object Qinternal_error, Qinvalid_state, Qstack_overflow, Qout_of_memory; |
50 Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; | 51 Lisp_Object Qvoid_variable, Qcyclic_variable_indirection; |
51 Lisp_Object Qvoid_function, Qcyclic_function_indirection; | 52 Lisp_Object Qvoid_function, Qcyclic_function_indirection; |
52 Lisp_Object Qinvalid_operation, Qinvalid_change; | 53 Lisp_Object Qinvalid_operation, Qinvalid_change, Qprinting_unreadable_object; |
53 Lisp_Object Qsetting_constant; | 54 Lisp_Object Qsetting_constant; |
54 Lisp_Object Qediting_error; | 55 Lisp_Object Qediting_error; |
55 Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; | 56 Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; |
56 Lisp_Object Qio_error, Qend_of_file; | 57 Lisp_Object Qio_error, Qfile_error, Qconversion_error, Qend_of_file; |
57 Lisp_Object Qarith_error, Qrange_error, Qdomain_error; | 58 Lisp_Object Qarith_error, Qrange_error, Qdomain_error; |
58 Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; | 59 Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error; |
59 Lisp_Object Qintegerp, Qnatnump, Qsymbolp; | 60 Lisp_Object Qintegerp, Qnatnump, Qsymbolp; |
60 Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; | 61 Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp; |
61 Lisp_Object Qconsp, Qsubrp; | 62 Lisp_Object Qconsp, Qsubrp; |
63 Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qbufferp; | 64 Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qbufferp; |
64 Lisp_Object Qinteger_or_char_p, Qinteger_char_or_marker_p; | 65 Lisp_Object Qinteger_or_char_p, Qinteger_char_or_marker_p; |
65 Lisp_Object Qnumberp, Qnumber_char_or_marker_p; | 66 Lisp_Object Qnumberp, Qnumber_char_or_marker_p; |
66 Lisp_Object Qbit_vectorp, Qbitp, Qcdr; | 67 Lisp_Object Qbit_vectorp, Qbitp, Qcdr; |
67 | 68 |
69 Lisp_Object Qerror_lacks_explanatory_string; | |
68 Lisp_Object Qfloatp; | 70 Lisp_Object Qfloatp; |
69 | 71 |
70 #ifdef DEBUG_XEMACS | 72 #ifdef DEBUG_XEMACS |
71 | 73 |
72 int debug_issue_ebola_notices; | 74 int debug_issue_ebola_notices; |
111 } | 113 } |
112 | 114 |
113 DOESNT_RETURN | 115 DOESNT_RETURN |
114 dead_wrong_type_argument (Lisp_Object predicate, Lisp_Object value) | 116 dead_wrong_type_argument (Lisp_Object predicate, Lisp_Object value) |
115 { | 117 { |
116 signal_error (Qwrong_type_argument, list2 (predicate, value)); | 118 signal_error_1 (Qwrong_type_argument, list2 (predicate, value)); |
117 } | 119 } |
118 | 120 |
119 DEFUN ("wrong-type-argument", Fwrong_type_argument, 2, 2, 0, /* | 121 DEFUN ("wrong-type-argument", Fwrong_type_argument, 2, 2, 0, /* |
120 Signal an error until the correct type value is given by the user. | 122 Signal an error until the correct type value is given by the user. |
121 This function loops, signalling a continuable `wrong-type-argument' error | 123 This function loops, signalling a continuable `wrong-type-argument' error |
129 } | 131 } |
130 | 132 |
131 DOESNT_RETURN | 133 DOESNT_RETURN |
132 c_write_error (Lisp_Object obj) | 134 c_write_error (Lisp_Object obj) |
133 { | 135 { |
134 signal_simple_error ("Attempt to modify read-only object (c)", obj); | 136 signal_error (Qsetting_constant, |
137 "Attempt to modify read-only object (c)", obj); | |
135 } | 138 } |
136 | 139 |
137 DOESNT_RETURN | 140 DOESNT_RETURN |
138 lisp_write_error (Lisp_Object obj) | 141 lisp_write_error (Lisp_Object obj) |
139 { | 142 { |
140 signal_simple_error ("Attempt to modify read-only object (lisp)", obj); | 143 signal_error (Qsetting_constant, |
144 "Attempt to modify read-only object (lisp)", obj); | |
141 } | 145 } |
142 | 146 |
143 DOESNT_RETURN | 147 DOESNT_RETURN |
144 args_out_of_range (Lisp_Object a1, Lisp_Object a2) | 148 args_out_of_range (Lisp_Object a1, Lisp_Object a2) |
145 { | 149 { |
146 signal_error (Qargs_out_of_range, list2 (a1, a2)); | 150 signal_error_1 (Qargs_out_of_range, list2 (a1, a2)); |
147 } | 151 } |
148 | 152 |
149 DOESNT_RETURN | 153 DOESNT_RETURN |
150 args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) | 154 args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) |
151 { | 155 { |
152 signal_error (Qargs_out_of_range, list3 (a1, a2, a3)); | 156 signal_error_1 (Qargs_out_of_range, list3 (a1, a2, a3)); |
153 } | 157 } |
154 | 158 |
155 void | 159 void |
156 check_int_range (EMACS_INT val, EMACS_INT min, EMACS_INT max) | 160 check_int_range (EMACS_INT val, EMACS_INT min, EMACS_INT max) |
157 { | 161 { |
1580 | 1584 |
1581 static void | 1585 static void |
1582 print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 1586 print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
1583 { | 1587 { |
1584 if (print_readably) | 1588 if (print_readably) |
1585 error ("printing unreadable object #<weak-list>"); | 1589 printing_unreadable_object ("#<weak-list>"); |
1586 | 1590 |
1587 write_c_string ("#<weak-list ", printcharfun); | 1591 write_c_string ("#<weak-list ", printcharfun); |
1588 print_internal (encode_weak_list_type (XWEAK_LIST (obj)->type), | 1592 print_internal (encode_weak_list_type (XWEAK_LIST (obj)->type), |
1589 printcharfun, 0); | 1593 printcharfun, 0); |
1590 write_c_string (" ", printcharfun); | 1594 write_c_string (" ", printcharfun); |
1908 if (EQ (symbol, Qold_assoc)) return WEAK_LIST_ASSOC; /* EBOLA ALERT! */ | 1912 if (EQ (symbol, Qold_assoc)) return WEAK_LIST_ASSOC; /* EBOLA ALERT! */ |
1909 if (EQ (symbol, Qkey_assoc)) return WEAK_LIST_KEY_ASSOC; | 1913 if (EQ (symbol, Qkey_assoc)) return WEAK_LIST_KEY_ASSOC; |
1910 if (EQ (symbol, Qvalue_assoc)) return WEAK_LIST_VALUE_ASSOC; | 1914 if (EQ (symbol, Qvalue_assoc)) return WEAK_LIST_VALUE_ASSOC; |
1911 if (EQ (symbol, Qfull_assoc)) return WEAK_LIST_FULL_ASSOC; | 1915 if (EQ (symbol, Qfull_assoc)) return WEAK_LIST_FULL_ASSOC; |
1912 | 1916 |
1913 signal_simple_error ("Invalid weak list type", symbol); | 1917 invalid_constant ("Invalid weak list type", symbol); |
1914 return WEAK_LIST_SIMPLE; /* not reached */ | 1918 return WEAK_LIST_SIMPLE; /* not reached */ |
1915 } | 1919 } |
1916 | 1920 |
1917 static Lisp_Object | 1921 static Lisp_Object |
1918 encode_weak_list_type (enum weak_list_type type) | 1922 encode_weak_list_type (enum weak_list_type type) |
2009 static SIGTYPE | 2013 static SIGTYPE |
2010 arith_error (int signo) | 2014 arith_error (int signo) |
2011 { | 2015 { |
2012 EMACS_REESTABLISH_SIGNAL (signo, arith_error); | 2016 EMACS_REESTABLISH_SIGNAL (signo, arith_error); |
2013 EMACS_UNBLOCK_SIGNAL (signo); | 2017 EMACS_UNBLOCK_SIGNAL (signo); |
2014 signal_error (Qarith_error, Qnil); | 2018 signal_error (Qarith_error, 0, Qunbound); |
2015 } | 2019 } |
2016 | 2020 |
2017 void | 2021 void |
2018 init_data_very_early (void) | 2022 init_data_very_early (void) |
2019 { | 2023 { |
2044 else is right */ | 2048 else is right */ |
2045 | 2049 |
2046 DEFERROR (Qerror, "error", Qnil); | 2050 DEFERROR (Qerror, "error", Qnil); |
2047 DEFERROR_STANDARD (Qquit, Qnil); | 2051 DEFERROR_STANDARD (Qquit, Qnil); |
2048 | 2052 |
2049 DEFERROR (Qunimplemented, "Feature not yet implemented", Qerror); | 2053 DEFERROR_STANDARD (Qinvalid_argument, Qerror); |
2050 DEFERROR_STANDARD (Qsyntax_error, Qerror); | 2054 |
2055 DEFERROR_STANDARD (Qsyntax_error, Qinvalid_argument); | |
2051 DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error); | 2056 DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error); |
2052 DEFERROR_STANDARD (Qlist_formation_error, Qsyntax_error); | 2057 DEFERROR_STANDARD (Qstructure_formation_error, Qsyntax_error); |
2053 | 2058 DEFERROR_STANDARD (Qlist_formation_error, Qstructure_formation_error); |
2054 /* Generated by list traversal macros */ | |
2055 DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error); | 2059 DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error); |
2056 DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list); | 2060 DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list); |
2057 DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error); | 2061 DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error); |
2058 DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list); | 2062 DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list); |
2059 | 2063 |
2060 DEFERROR_STANDARD (Qinvalid_argument, Qerror); | |
2061 DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument); | 2064 DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument); |
2062 DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument); | 2065 DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument); |
2063 DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument); | 2066 DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument); |
2064 DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument); | 2067 DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument); |
2068 DEFERROR_STANDARD (Qinvalid_constant, Qinvalid_argument); | |
2065 DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument); | 2069 DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument); |
2066 | 2070 |
2067 DEFERROR_STANDARD (Qinternal_error, Qerror); | 2071 DEFERROR_STANDARD (Qinvalid_state, Qerror); |
2068 | |
2069 DEFERROR (Qinvalid_state, "Properties or values have been set incorrectly", | |
2070 Qerror); | |
2071 DEFERROR (Qvoid_function, "Symbol's function definition is void", | 2072 DEFERROR (Qvoid_function, "Symbol's function definition is void", |
2072 Qinvalid_state); | 2073 Qinvalid_state); |
2073 DEFERROR (Qcyclic_function_indirection, | 2074 DEFERROR (Qcyclic_function_indirection, |
2074 "Symbol's chain of function indirections contains a loop", | 2075 "Symbol's chain of function indirections contains a loop", |
2075 Qinvalid_state); | 2076 Qinvalid_state); |
2076 DEFERROR (Qvoid_variable, "Symbol's value as variable is void", | 2077 DEFERROR (Qvoid_variable, "Symbol's value as variable is void", |
2077 Qinvalid_state); | 2078 Qinvalid_state); |
2078 DEFERROR (Qcyclic_variable_indirection, | 2079 DEFERROR (Qcyclic_variable_indirection, |
2079 "Symbol's chain of variable indirections contains a loop", | 2080 "Symbol's chain of variable indirections contains a loop", |
2080 Qinvalid_state); | 2081 Qinvalid_state); |
2081 | 2082 DEFERROR_STANDARD (Qstack_overflow, Qinvalid_state); |
2082 DEFERROR (Qinvalid_operation, | 2083 DEFERROR_STANDARD (Qinternal_error, Qinvalid_state); |
2083 "Operation not allowed or error during operation", Qerror); | 2084 DEFERROR_STANDARD (Qout_of_memory, Qinvalid_state); |
2084 DEFERROR (Qinvalid_change, "Attempt to set properties or values incorrectly", | 2085 |
2085 Qinvalid_operation); | 2086 DEFERROR_STANDARD (Qinvalid_operation, Qerror); |
2087 DEFERROR_STANDARD (Qinvalid_change, Qinvalid_operation); | |
2086 DEFERROR (Qsetting_constant, "Attempt to set a constant symbol", | 2088 DEFERROR (Qsetting_constant, "Attempt to set a constant symbol", |
2087 Qinvalid_change); | 2089 Qinvalid_change); |
2088 | 2090 DEFERROR_STANDARD (Qprinting_unreadable_object, Qinvalid_operation); |
2089 DEFERROR (Qediting_error, "Invalid operation during editing", | 2091 DEFERROR (Qunimplemented, "Feature not yet implemented", Qinvalid_operation); |
2090 Qinvalid_operation); | 2092 |
2093 DEFERROR_STANDARD (Qediting_error, Qinvalid_operation); | |
2091 DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error); | 2094 DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error); |
2092 DEFERROR_STANDARD (Qend_of_buffer, Qediting_error); | 2095 DEFERROR_STANDARD (Qend_of_buffer, Qediting_error); |
2093 DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error); | 2096 DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error); |
2094 | 2097 |
2095 DEFERROR (Qio_error, "IO Error", Qinvalid_operation); | 2098 DEFERROR (Qio_error, "IO Error", Qinvalid_operation); |
2096 DEFERROR (Qend_of_file, "End of file or stream", Qio_error); | 2099 DEFERROR_STANDARD (Qfile_error, Qio_error); |
2100 DEFERROR (Qend_of_file, "End of file or stream", Qfile_error); | |
2101 DEFERROR_STANDARD (Qconversion_error, Qio_error); | |
2097 | 2102 |
2098 DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation); | 2103 DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation); |
2099 DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error); | 2104 DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error); |
2100 DEFERROR (Qdomain_error, "Arithmetic domain error", Qarith_error); | 2105 DEFERROR (Qdomain_error, "Arithmetic domain error", Qarith_error); |
2101 DEFERROR (Qsingularity_error, "Arithmetic singularity error", Qdomain_error); | 2106 DEFERROR (Qsingularity_error, "Arithmetic singularity error", Qdomain_error); |
2131 DEFSYMBOL (Qinteger_or_char_p); | 2136 DEFSYMBOL (Qinteger_or_char_p); |
2132 DEFSYMBOL (Qinteger_char_or_marker_p); | 2137 DEFSYMBOL (Qinteger_char_or_marker_p); |
2133 DEFSYMBOL (Qnumberp); | 2138 DEFSYMBOL (Qnumberp); |
2134 DEFSYMBOL (Qnumber_char_or_marker_p); | 2139 DEFSYMBOL (Qnumber_char_or_marker_p); |
2135 DEFSYMBOL (Qcdr); | 2140 DEFSYMBOL (Qcdr); |
2141 DEFSYMBOL (Qerror_lacks_explanatory_string); | |
2136 DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp); | 2142 DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp); |
2137 | 2143 |
2138 #ifdef LISP_FLOAT_TYPE | 2144 #ifdef LISP_FLOAT_TYPE |
2139 DEFSYMBOL (Qfloatp); | 2145 DEFSYMBOL (Qfloatp); |
2140 #endif /* LISP_FLOAT_TYPE */ | 2146 #endif /* LISP_FLOAT_TYPE */ |