diff src/window.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 0784d089fdc9
children 190b164ddcac
line wrap: on
line diff
--- a/src/window.c	Thu May 24 06:30:21 2001 +0000
+++ b/src/window.c	Thu May 24 07:51:33 2001 +0000
@@ -184,8 +184,7 @@
   char buf[200];
 
   if (print_readably)
-    error ("printing unreadable object #<window 0x%x>",
-           XWINDOW (obj)->header.uid);
+    printing_unreadable_object ("#<window 0x%x>", XWINDOW (obj)->header.uid);
 
   write_c_string ("#<window", printcharfun);
   if (!NILP (XWINDOW (obj)->buffer))
@@ -1977,7 +1976,7 @@
 	return Qnil;
 
       if (MINI_WINDOW_P (XWINDOW (window)))
-	error ("Attempt to delete the minibuffer window");
+	signal_error (Qinvalid_operation, "Attempt to delete the minibuffer window", Qunbound);
 
       /* It has been suggested that it's a good thing for C-x 0 to have this
 	 behavior, but not such a good idea for #'delete-window to have it.
@@ -2973,7 +2972,7 @@
   XSETWINDOW (window, w);
 
   if (MINI_WINDOW_P (w) && old_top > 0)
-    error ("Can't expand minibuffer to full frame");
+    invalid_operation ("Can't expand minibuffer to full frame", Qunbound);
 
   /* Ignore dedicated windows. */
   window_loop (DELETE_OTHER_WINDOWS, window, 0, w->frame, 0, Qnil);
@@ -3389,11 +3388,11 @@
   CHECK_BUFFER (buffer);
 
   if (!BUFFER_LIVE_P (XBUFFER (buffer)))
-    error ("Attempt to display deleted buffer");
+    invalid_operation ("Attempt to display deleted buffer", Qunbound);
 
   tem = w->buffer;
   if (NILP (tem))
-    error ("Window is deleted");
+    invalid_operation ("Window is deleted", Qunbound);
 
   /* While this seems like a logical thing to do, it causes problems
      because of saved window configurations.  It is possible for a
@@ -3412,8 +3411,7 @@
 				   is first being set up.  */
     {
       if (!NILP (w->dedicated) && !EQ (tem, buffer))
-	error ("Window is dedicated to buffer %s",
-	       XSTRING_DATA (XBUFFER (tem)->name));
+	signal_error (Qinvalid_operation, "Window is dedicated to buffer", tem);
 
       old_buffer_local_face_property =
 	XBUFFER (w->buffer)->buffer_local_face_property;
@@ -3475,7 +3473,7 @@
 
   /* we have already caught dead-window errors */
   if (!NILP (w->hchild) || !NILP (w->vchild))
-    error ("Trying to select non-leaf window");
+    invalid_operation ("Trying to select non-leaf window", Qunbound);
 
   w->use_time = make_int (++window_select_count);
 
@@ -3672,19 +3670,19 @@
     }
 
   if (MINI_WINDOW_P (o))
-    error ("Attempt to split minibuffer window");
+    invalid_operation ("Attempt to split minibuffer window", Qunbound);
   else if (FRAME_NO_SPLIT_P (XFRAME (WINDOW_FRAME (o))))
-    error ("Attempt to split unsplittable frame");
+    invalid_operation ("Attempt to split unsplittable frame", Qunbound);
 
   check_min_window_sizes ();
 
   if (NILP (horflag))
     {
       if (csize < window_min_height)
-	error ("Window height %d too small (after splitting)", csize);
+	signal_error (Qinvalid_operation, "Window height too small (after splitting)", make_int (csize));
       if (csize + window_min_height > window_char_height (o, 1))
-	error ("Window height %d too small (after splitting)",
-	       window_char_height (o, 1) - csize);
+	signal_error (Qinvalid_operation, "Window height too small (after splitting)",
+	       make_int (window_char_height (o, 1) - csize));
       if (NILP (o->parent)
 	  || NILP (XWINDOW (o->parent)->vchild))
 	{
@@ -3703,10 +3701,10 @@
   else
     {
       if (csize < window_min_width)
-	error ("Window width %d too small (after splitting)", csize);
+	signal_error (Qinvalid_operation, "Window width too small (after splitting)", make_int (csize));
       if (csize + window_min_width > window_char_width (o, 0))
-	error ("Window width %d too small (after splitting)",
-	       window_char_width (o, 0) - csize);
+	signal_error (Qinvalid_operation, "Window width too small (after splitting)",
+	       make_int (window_char_width (o, 0) - csize));
       if (NILP (o->parent)
 	  || NILP (XWINDOW (o->parent)->hchild))
 	{
@@ -4089,7 +4087,7 @@
   XSETWINDOW (window, win);
   f = XFRAME (win->frame);
   if (EQ (window, FRAME_ROOT_WINDOW (f)))
-    error ("Won't change only window");
+    invalid_operation ("Won't change only window", Qunbound);
 
   /* #### This is very likely incorrect and instead the char_to_pixel_
      functions should be called. */
@@ -4102,7 +4100,7 @@
       if (NILP (parent))
 	{
 	  if (widthflag)
-	    error ("No other window to side of this one");
+	    invalid_operation ("No other window to side of this one", Qunbound);
 	  break;
 	}
       if (widthflag
@@ -4354,7 +4352,7 @@
 	      (w->window_end_pos[CURRENT_DISP] == -1
 	       || (BUF_Z (b) - w->window_end_pos[CURRENT_DISP] > BUF_ZV (b))))
 	    {
-	      maybe_signal_error (Qend_of_buffer, Qnil, Qwindow, errb);
+	      maybe_signal_error_1 (Qend_of_buffer, Qnil, Qwindow, errb);
 	      return;
 	    }
 	  else
@@ -4411,7 +4409,7 @@
 	  if (vtarget > value
 	      && marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b))
 	    {
-	      maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb);
+	      maybe_signal_error_1 (Qbeginning_of_buffer, Qnil, Qwindow, errb);
 	      return;
 	    }
 	  else
@@ -4468,7 +4466,7 @@
 	}
       if (marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b))
 	{
-	  maybe_signal_error (Qbeginning_of_buffer, Qnil, Qwindow, errb);
+	  maybe_signal_error_1 (Qbeginning_of_buffer, Qnil, Qwindow, errb);
 	  return;
 	}
       else
@@ -4585,7 +4583,7 @@
   CHECK_LIVE_WINDOW (window);
 
   if (EQ (window, selected_window))
-    error ("There is no other window");
+    invalid_operation ("There is no other window", Qunbound);
 
   return window;
  }
@@ -5090,8 +5088,8 @@
   struct window_config *config = XWINDOW_CONFIGURATION (obj);
   char buf[200];
   if (print_readably)
-    error ("printing unreadable object #<window-configuration 0x%x>",
-           config->header.uid);
+    printing_unreadable_object ("#<window-configuration 0x%x>",
+				config->header.uid);
   write_c_string ("#<window-configuration ", printcharfun);
   sprintf (buf, "0x%x>", config->header.uid);
   write_c_string (buf, printcharfun);
@@ -6066,20 +6064,20 @@
   INIT_LRECORD_IMPLEMENTATION (window);
   INIT_LRECORD_IMPLEMENTATION (window_configuration);
 
-  defsymbol (&Qwindowp, "windowp");
-  defsymbol (&Qwindow_live_p, "window-live-p");
-  defsymbol (&Qwindow_configurationp, "window-configuration-p");
-  defsymbol (&Qtemp_buffer_show_hook, "temp-buffer-show-hook");
-  defsymbol (&Qdisplay_buffer, "display-buffer");
+  DEFSYMBOL (Qwindowp);
+  DEFSYMBOL (Qwindow_live_p);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qwindow_configurationp);
+  DEFSYMBOL (Qtemp_buffer_show_hook);
+  DEFSYMBOL (Qdisplay_buffer);
 
 #ifdef MEMORY_USAGE_STATS
-  defsymbol (&Qface_cache, "face-cache");
-  defsymbol (&Qglyph_cache, "glyph-cache");
-  defsymbol (&Qline_start_cache, "line-start-cache");
+  DEFSYMBOL (Qface_cache);
+  DEFSYMBOL (Qglyph_cache);
+  DEFSYMBOL (Qline_start_cache);
 #ifdef HAVE_SCROLLBARS
-  defsymbol (&Qscrollbar_instances, "scrollbar-instances");
+  DEFSYMBOL (Qscrollbar_instances);
 #endif
-  defsymbol (&Qother_redisplay, "other-redisplay");
+  DEFSYMBOL (Qother_redisplay);
   /* Qother in general.c */
 #endif