diff 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
line wrap: on
line diff
--- a/src/data.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/data.c	Thu May 24 07:51:33 2001 +0000
@@ -1,7 +1,7 @@
 /* Primitive operations on Lisp data types for XEmacs Lisp interpreter.
    Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
-   Copyright (C) 2000 Ben Wing.
+   Copyright (C) 2000, 2001 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -41,19 +41,20 @@
 Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
 Lisp_Object Qerror_conditions, Qerror_message;
 Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax;
-Lisp_Object Qlist_formation_error;
+Lisp_Object Qlist_formation_error, Qstructure_formation_error;
 Lisp_Object Qmalformed_list, Qmalformed_property_list;
 Lisp_Object Qcircular_list, Qcircular_property_list;
-Lisp_Object Qinvalid_argument, Qwrong_type_argument, Qargs_out_of_range;
+Lisp_Object Qinvalid_argument, Qinvalid_constant, Qwrong_type_argument;
+Lisp_Object Qargs_out_of_range;
 Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch;
-Lisp_Object Qinternal_error, Qinvalid_state;
+Lisp_Object Qinternal_error, Qinvalid_state, Qstack_overflow, Qout_of_memory;
 Lisp_Object Qvoid_variable, Qcyclic_variable_indirection;
 Lisp_Object Qvoid_function, Qcyclic_function_indirection;
-Lisp_Object Qinvalid_operation, Qinvalid_change;
+Lisp_Object Qinvalid_operation, Qinvalid_change, Qprinting_unreadable_object;
 Lisp_Object Qsetting_constant;
 Lisp_Object Qediting_error;
 Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
-Lisp_Object Qio_error, Qend_of_file;
+Lisp_Object Qio_error, Qfile_error, Qconversion_error, Qend_of_file;
 Lisp_Object Qarith_error, Qrange_error, Qdomain_error;
 Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error;
 Lisp_Object Qintegerp, Qnatnump, Qsymbolp;
@@ -65,6 +66,7 @@
 Lisp_Object Qnumberp, Qnumber_char_or_marker_p;
 Lisp_Object Qbit_vectorp, Qbitp, Qcdr;
 
+Lisp_Object Qerror_lacks_explanatory_string;
 Lisp_Object Qfloatp;
 
 #ifdef DEBUG_XEMACS
@@ -113,7 +115,7 @@
 DOESNT_RETURN
 dead_wrong_type_argument (Lisp_Object predicate, Lisp_Object value)
 {
-  signal_error (Qwrong_type_argument, list2 (predicate, value));
+  signal_error_1 (Qwrong_type_argument, list2 (predicate, value));
 }
 
 DEFUN ("wrong-type-argument", Fwrong_type_argument, 2, 2, 0, /*
@@ -131,25 +133,27 @@
 DOESNT_RETURN
 c_write_error (Lisp_Object obj)
 {
-  signal_simple_error ("Attempt to modify read-only object (c)", obj);
+  signal_error (Qsetting_constant,
+		"Attempt to modify read-only object (c)", obj);
 }
 
 DOESNT_RETURN
 lisp_write_error (Lisp_Object obj)
 {
-  signal_simple_error ("Attempt to modify read-only object (lisp)", obj);
+  signal_error (Qsetting_constant,
+		"Attempt to modify read-only object (lisp)", obj);
 }
 
 DOESNT_RETURN
 args_out_of_range (Lisp_Object a1, Lisp_Object a2)
 {
-  signal_error (Qargs_out_of_range, list2 (a1, a2));
+  signal_error_1 (Qargs_out_of_range, list2 (a1, a2));
 }
 
 DOESNT_RETURN
 args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3)
 {
-  signal_error (Qargs_out_of_range, list3 (a1, a2, a3));
+  signal_error_1 (Qargs_out_of_range, list3 (a1, a2, a3));
 }
 
 void
@@ -1582,7 +1586,7 @@
 print_weak_list (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
   if (print_readably)
-    error ("printing unreadable object #<weak-list>");
+    printing_unreadable_object ("#<weak-list>");
 
   write_c_string ("#<weak-list ", printcharfun);
   print_internal (encode_weak_list_type (XWEAK_LIST (obj)->type),
@@ -1910,7 +1914,7 @@
   if (EQ (symbol, Qvalue_assoc)) return WEAK_LIST_VALUE_ASSOC;
   if (EQ (symbol, Qfull_assoc))  return WEAK_LIST_FULL_ASSOC;
 
-  signal_simple_error ("Invalid weak list type", symbol);
+  invalid_constant ("Invalid weak list type", symbol);
   return WEAK_LIST_SIMPLE; /* not reached */
 }
 
@@ -2011,7 +2015,7 @@
 {
   EMACS_REESTABLISH_SIGNAL (signo, arith_error);
   EMACS_UNBLOCK_SIGNAL (signo);
-  signal_error (Qarith_error, Qnil);
+  signal_error (Qarith_error, 0, Qunbound);
 }
 
 void
@@ -2046,28 +2050,25 @@
   DEFERROR (Qerror, "error", Qnil);
   DEFERROR_STANDARD (Qquit, Qnil);
 
-  DEFERROR (Qunimplemented, "Feature not yet implemented", Qerror);
-  DEFERROR_STANDARD (Qsyntax_error, Qerror);
+  DEFERROR_STANDARD (Qinvalid_argument, Qerror);
+
+  DEFERROR_STANDARD (Qsyntax_error, Qinvalid_argument);
   DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error);
-  DEFERROR_STANDARD (Qlist_formation_error, Qsyntax_error);
-
-  /* Generated by list traversal macros */
+  DEFERROR_STANDARD (Qstructure_formation_error, Qsyntax_error);
+  DEFERROR_STANDARD (Qlist_formation_error, Qstructure_formation_error);
   DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error);
   DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list);
   DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error);
   DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list);
 
-  DEFERROR_STANDARD (Qinvalid_argument, Qerror);
   DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument);
   DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument);
   DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument);
   DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument);
+  DEFERROR_STANDARD (Qinvalid_constant, Qinvalid_argument);
   DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument);
 
-  DEFERROR_STANDARD (Qinternal_error, Qerror);
-
-  DEFERROR (Qinvalid_state, "Properties or values have been set incorrectly",
-	    Qerror);
+  DEFERROR_STANDARD (Qinvalid_state, Qerror);
   DEFERROR (Qvoid_function, "Symbol's function definition is void",
 	    Qinvalid_state);
   DEFERROR (Qcyclic_function_indirection,
@@ -2078,22 +2079,26 @@
   DEFERROR (Qcyclic_variable_indirection,
 	    "Symbol's chain of variable indirections contains a loop",
 	    Qinvalid_state);
+  DEFERROR_STANDARD (Qstack_overflow, Qinvalid_state);
+  DEFERROR_STANDARD (Qinternal_error, Qinvalid_state);
+  DEFERROR_STANDARD (Qout_of_memory, Qinvalid_state);
 
-  DEFERROR (Qinvalid_operation,
-	    "Operation not allowed or error during operation", Qerror);
-  DEFERROR (Qinvalid_change, "Attempt to set properties or values incorrectly",
-	    Qinvalid_operation);
+  DEFERROR_STANDARD (Qinvalid_operation, Qerror);
+  DEFERROR_STANDARD (Qinvalid_change, Qinvalid_operation);
   DEFERROR (Qsetting_constant, "Attempt to set a constant symbol",
 	    Qinvalid_change);
+  DEFERROR_STANDARD (Qprinting_unreadable_object, Qinvalid_operation);
+  DEFERROR (Qunimplemented, "Feature not yet implemented", Qinvalid_operation);
 
-  DEFERROR (Qediting_error, "Invalid operation during editing",
-	    Qinvalid_operation);
+  DEFERROR_STANDARD (Qediting_error, Qinvalid_operation);
   DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error);
   DEFERROR_STANDARD (Qend_of_buffer, Qediting_error);
   DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error);
 
   DEFERROR (Qio_error, "IO Error", Qinvalid_operation);
-  DEFERROR (Qend_of_file, "End of file or stream", Qio_error);
+  DEFERROR_STANDARD (Qfile_error, Qio_error);
+  DEFERROR (Qend_of_file, "End of file or stream", Qfile_error);
+  DEFERROR_STANDARD (Qconversion_error, Qio_error);
 
   DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation);
   DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error);
@@ -2133,6 +2138,7 @@
   DEFSYMBOL (Qnumberp);
   DEFSYMBOL (Qnumber_char_or_marker_p);
   DEFSYMBOL (Qcdr);
+  DEFSYMBOL (Qerror_lacks_explanatory_string);
   DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp);
 
 #ifdef LISP_FLOAT_TYPE