diff src/events.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 7039e6323819
children b39c14581166
line wrap: on
line diff
--- a/src/events.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/events.c	Thu May 24 07:51:33 2001 +0000
@@ -143,7 +143,7 @@
 print_event (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
   if (print_readably)
-    error ("Printing unreadable object #<event>");
+    printing_unreadable_object ("#<event>");
 
   switch (XEVENT (obj)->event_type)
     {
@@ -458,7 +458,7 @@
          (e.g. CHANNEL), which we don't want in empty events.  */
       e->event_type = empty_event;
       if (!NILP (plist))
-	syntax_error ("Cannot set properties of empty event", plist);
+	invalid_operation ("Cannot set properties of empty event", plist);
       UNGCPRO;
       return event;
     }
@@ -481,7 +481,7 @@
   else
     {
       /* Not allowed: Qprocess, Qtimeout, Qmagic, Qeval, Qmagic_eval.  */
-      invalid_argument ("Invalid event type", type);
+      invalid_constant ("Invalid event type", type);
     }
 
   EVENT_CHANNEL (e) = Qnil;
@@ -490,7 +490,7 @@
   Fcanonicalize_plist (plist, Qnil);
 
 #define WRONG_EVENT_TYPE_FOR_PROPERTY(event_type, prop) \
-  syntax_error_2 ("Invalid property for event type", prop, event_type)
+  invalid_argument_2 ("Invalid property for event type", prop, event_type)
 
   {
     EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, plist)
@@ -515,7 +515,7 @@
 	      {
 	      case key_press_event:
 		if (!SYMBOLP (value) && !CHARP (value))
-		  syntax_error ("Invalid event key", value);
+		  invalid_argument ("Invalid event key", value);
 		e->event.key.keysym = value;
 		break;
 	      default:
@@ -561,7 +561,7 @@
 		else if (EQ (sym, Qbutton4))   modifiers |= XEMACS_MOD_BUTTON4;
 		else if (EQ (sym, Qbutton5))   modifiers |= XEMACS_MOD_BUTTON5;
 		else
-		  syntax_error ("Invalid key modifier", sym);
+		  invalid_constant ("Invalid key modifier", sym);
 	      }
 
 	    switch (e->event_type)
@@ -649,7 +649,7 @@
 	      }
 	  }
 	else
-	  syntax_error_2 ("Invalid property", keyword, value);
+	  invalid_constant_2 ("Invalid property", keyword, value);
       }
   }
 
@@ -694,24 +694,24 @@
     {
     case key_press_event:
       if (UNBOUNDP (e->event.key.keysym))
-	syntax_error ("A key must be specified to make a keypress event",
+	sferror ("A key must be specified to make a keypress event",
 		      plist);
       break;
     case button_press_event:
       if (!e->event.button.button)
-	syntax_error
+	sferror
 	  ("A button must be specified to make a button-press event",
 	   plist);
       break;
     case button_release_event:
       if (!e->event.button.button)
-	syntax_error
+	sferror
 	  ("A button must be specified to make a button-release event",
 	   plist);
       break;
     case misc_user_event:
       if (NILP (e->event.misc.function))
-	syntax_error ("A function must be specified to make a misc-user event",
+	sferror ("A function must be specified to make a misc-user event",
 		      plist);
       break;
     default:
@@ -735,7 +735,7 @@
   CHECK_EVENT (event);
 
   if (XEVENT_TYPE (event) == dead_event)
-    error ("this event is already deallocated!");
+    invalid_argument ("this event is already deallocated!", Qunbound);
 
   assert (XEVENT_TYPE (event) <= last_event_type);
 
@@ -787,8 +787,9 @@
     {
       CHECK_LIVE_EVENT (event2);
       if (EQ (event1, event2))
-	return signal_simple_continuable_error_2
-	  ("copy-event called with `eq' events", event1, event2);
+	return signal_continuable_error_2
+	  (Qinvalid_argument,
+	   "copy-event called with `eq' events", event1, event2);
     }
 
   assert (XEVENT_TYPE (event1) <= last_event_type);
@@ -988,7 +989,7 @@
   Lisp_Object k = Qnil;
   int m = 0;
   if (event->event_type == dead_event)
-    error ("character-to-event called with a deallocated event!");
+    invalid_argument ("character-to-event called with a deallocated event!", Qunbound);
 
 #ifndef MULE
   c &= 255;
@@ -1415,10 +1416,7 @@
     {
       QUIT;
       if (EQ (ev, event))
-	signal_error (Qerror,
-		      list3 (build_string ("Cyclic event-next"),
-			     event,
-			     next_event));
+	invalid_operation_2 ("Cyclic event-next", event, next_event);
     }
   XSET_EVENT_NEXT (event, next_event);
   return next_event;
@@ -2323,17 +2321,17 @@
   DEFSUBR (Fevent_function);
   DEFSUBR (Fevent_object);
 
-  defsymbol (&Qeventp, "eventp");
-  defsymbol (&Qevent_live_p, "event-live-p");
-  defsymbol (&Qkey_press_event_p, "key-press-event-p");
-  defsymbol (&Qbutton_event_p, "button-event-p");
-  defsymbol (&Qmouse_event_p, "mouse-event-p");
-  defsymbol (&Qprocess_event_p, "process-event-p");
-  defsymbol (&Qkey_press, "key-press");
-  defsymbol (&Qbutton_press, "button-press");
-  defsymbol (&Qbutton_release, "button-release");
-  defsymbol (&Qmisc_user, "misc-user");
-  defsymbol (&Qascii_character, "ascii-character");
+  DEFSYMBOL (Qeventp);
+  DEFSYMBOL (Qevent_live_p);
+  DEFSYMBOL (Qkey_press_event_p);
+  DEFSYMBOL (Qbutton_event_p);
+  DEFSYMBOL (Qmouse_event_p);
+  DEFSYMBOL (Qprocess_event_p);
+  DEFSYMBOL (Qkey_press);
+  DEFSYMBOL (Qbutton_press);
+  DEFSYMBOL (Qbutton_release);
+  DEFSYMBOL (Qmisc_user);
+  DEFSYMBOL (Qascii_character);
 
   defsymbol (&QKbackspace, "backspace");
   defsymbol (&QKtab, "tab");