diff src/device-x.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 576fb035e263
children 190b164ddcac
line wrap: on
line diff
--- a/src/device-x.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/device-x.c	Thu May 24 07:51:33 2001 +0000
@@ -211,7 +211,7 @@
 		  app_name, (char *) value.addr,
 		  app_class, (char *) value.addr);
       suppress_early_error_handler_backtrace = 1;
-      error ("Invalid geometry resource");
+      syntax_error ("Invalid geometry resource", Qunbound);
     }
 }
 
@@ -568,7 +568,7 @@
   if (dpy == 0)
     {
       suppress_early_error_handler_backtrace = 1;
-      signal_simple_error ("X server not responding\n", display);
+      gui_error ("X server not responding\n", display);
     }
 
   if (STRINGP (Vx_emacs_application_class) &&
@@ -1285,13 +1285,14 @@
   if (NILP (locale))
     locale = Qglobal;
   if (NILP (Fvalid_specifier_locale_p (locale)))
-    signal_simple_error ("Invalid locale", locale);
+    invalid_argument ("Invalid locale", locale);
   if (WINDOWP (locale))
     /* #### I can't come up with any coherent way of naming windows.
        By relative position?  That seems tricky because windows
        can change position, be split, etc.  By order of creation?
        That seems less than useful. */
-    signal_simple_error ("Windows currently can't be resourced", locale);
+    signal_error (Qunimplemented,
+		  "Windows currently can't be resourced", locale);
 
   if (!NILP (device) && !DEVICEP (device))
     CHECK_DEVICE (device);
@@ -1483,8 +1484,13 @@
     while (namerest[0] && classrest[0])
       namerest++, classrest++;
     if (namerest[0] || classrest[0])
-      signal_simple_error_2
-	("class list and name list must be the same length", name, class);
+      {
+	maybe_signal_error_2
+	  (Qstructure_formation_error,
+	   "class list and name list must be the same length", name, class,
+	   Qresource, errb);
+	return Qnil;
+      }
     result = XrmQGetResource (db, namelist, classlist, &xrm_type, &xrm_value);
 
     if (result != True || xrm_type != string_quark)
@@ -1504,33 +1510,32 @@
 	  !ascii_strcasecmp (raw_result, "true") ||
 	  !ascii_strcasecmp (raw_result, "yes"))
 	return Fcons (Qt, Qnil);
-      return maybe_continuable_error
-	(Qresource, errb,
-	 "can't convert %s: %s to a Boolean", name_string, raw_result);
+      return maybe_signal_continuable_error_2
+	(Qinvalid_operation, "Can't convert to a Boolean",
+	 build_string (name_string), build_string (raw_result), Qresource,
+	 errb);
     }
   else if (EQ (type, Qinteger) || EQ (type, Qnatnum))
     {
       int i;
       char c;
       if (1 != sscanf (raw_result, "%d%c", &i, &c))
-	return maybe_continuable_error
-	  (Qresource, errb,
-	   "can't convert %s: %s to an integer", name_string, raw_result);
+      return maybe_signal_continuable_error_2
+	(Qinvalid_operation, "Can't convert to an integer",
+	 build_string (name_string), build_string (raw_result), Qresource,
+	 errb);
       else if (EQ (type, Qnatnum) && i < 0)
-	return maybe_continuable_error
-	  (Qresource, errb,
-	   "invalid numerical value %d for resource %s", i, name_string);
+	return maybe_signal_continuable_error_2
+	  (Qinvalid_argument, "Invalid numerical value for resource",
+	   make_int (i), build_string (name_string), Qresource, errb);
       else
 	return make_int (i);
     }
   else
     {
       return maybe_signal_continuable_error
-	(Qwrong_type_argument,
-	 list2 (build_translated_string
-		("should be string, integer, natnum or boolean"),
-		type),
-	 Qresource, errb);
+	(Qwrong_type_argument, "Should be string, integer, natnum or boolean",
+	 type, Qresource, errb);
     }
 }
 
@@ -1576,7 +1581,7 @@
   str = (char *) XSTRING_DATA (resource_line);
   if (!(colon_pos = strchr (str, ':')) || strchr (str, '\n'))
   invalid:
-    signal_simple_error ("Invalid resource line", resource_line);
+    syntax_error ("Invalid resource line", resource_line);
   if (strspn (str,
 	      /* Only the following chars are allowed before the colon */
 	      " \t.*?abcdefghijklmnopqrstuvwxyz"
@@ -1625,7 +1630,7 @@
     case TrueColor:   return intern ("true-color");
     case DirectColor: return intern ("direct-color");
     default:
-      error ("display has an unknown visual class");
+      invalid_state ("display has an unknown visual class", Qunbound);
       return Qnil;	/* suppress compiler warning */
     }
 }
@@ -1711,7 +1716,7 @@
 {
   struct device *d = decode_device (device);
   if (!DEVICE_X_P (d))
-    signal_simple_error ("Not an X device", device);
+    gui_error ("Not an X device", device);
 
   return DEVICE_X_DATA (d)->x_keysym_map_hash_table;
 }
@@ -1732,7 +1737,7 @@
 {
   struct device *d = decode_device (device);
   if (!DEVICE_X_P (d))
-    signal_simple_error ("Not an X device", device);
+    gui_error ("Not an X device", device);
 
   return (EQ (Qsans_modifiers,
 	      Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d), Qnil)) ?
@@ -1755,7 +1760,7 @@
 {
   struct device *d = decode_device (device);
   if (!DEVICE_X_P (d))
-    signal_simple_error ("Not an X device", device);
+    gui_error ("Not an X device", device);
 
   return (NILP (Fgethash (keysym, DEVICE_X_KEYSYM_MAP_HASH_TABLE (d), Qnil)) ?
 	  Qnil : Qt);
@@ -1903,7 +1908,7 @@
   Lisp_Object font_path = Qnil;
 
   if (!directories)
-    signal_simple_error ("Can't get X font path", device);
+    gui_error ("Can't get X font path", device);
 
   while (ndirs_return--)
       font_path = Fcons (build_ext_string (directories[ndirs_return],
@@ -1985,9 +1990,9 @@
   DEFSUBR (Fx_get_font_path);
   DEFSUBR (Fx_set_font_path);
 
-  defsymbol (&Qx_error, "x-error");
-  defsymbol (&Qinit_pre_x_win, "init-pre-x-win");
-  defsymbol (&Qinit_post_x_win, "init-post-x-win");
+  DEFSYMBOL (Qx_error);
+  DEFSYMBOL (Qinit_pre_x_win);
+  DEFSYMBOL (Qinit_post_x_win);
 }
 
 void