Index: lisp/glyphs.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/glyphs.el,v
retrieving revision 1.6.2.4
diff -u -r1.6.2.4 glyphs.el
--- lisp/glyphs.el 2000/09/13 10:56:26 1.6.2.4
+++ lisp/glyphs.el 2000/11/28 17:12:16
@@ -1023,7 +1023,8 @@
 				 [jpeg :data nil] 2)))
        ,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2)))
        ,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2)))
-       ("" [autodetect :data nil] 2))))
+       ("" [string :data nil] 2)
+       ("" [nothing]))))
   ;; #### this should really be formatted-string, not string but we
   ;; don't have it implemented yet
   ;;
Index: lisp/x-mouse.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/x-mouse.el,v
retrieving revision 1.7.2.4
diff -u -r1.7.2.4 x-mouse.el
--- lisp/x-mouse.el 2000/11/06 05:44:09 1.7.2.4
+++ lisp/x-mouse.el 2000/11/28 17:12:17
@@ -101,39 +101,41 @@
       nil
     (set-glyph-image text-pointer-glyph
 	  (or (x-get-resource "textPointer" "Cursor" 'string device nil 'warn)
-	      "xterm"))
+	      [cursor-font :data "xterm"]))
     (set-glyph-image selection-pointer-glyph
 	  (or (x-get-resource "selectionPointer" "Cursor" 'string device
 			      nil 'warn)
-	      "top_left_arrow"))
+	      [cursor-font :data "top_left_arrow"]))
     (set-glyph-image nontext-pointer-glyph
 	  (or (x-get-resource "spacePointer" "Cursor" 'string device nil 'warn)
-	      "xterm")) ; was "crosshair"
+	      [cursor-font :data "xterm"])) ; was "crosshair"
     (set-glyph-image modeline-pointer-glyph
 	  (or (x-get-resource "modeLinePointer" "Cursor" 'string device
 			      nil 'warn)
 ;;	      "fleur"))
-	      "sb_v_double_arrow"))
+	      [cursor-font :data "sb_v_double_arrow"]))
     (set-glyph-image gc-pointer-glyph
 	  (or (x-get-resource "gcPointer" "Cursor" 'string device nil 'warn)
-	      "watch"))
+	      [cursor-font :data "watch"]))
     (when (featurep 'scrollbar)
       (set-glyph-image
        scrollbar-pointer-glyph
        (or (x-get-resource "scrollbarPointer" "Cursor" 'string device
 			   nil 'warn)
-	   "top_left_arrow")))
+	   ;; bizarrely if we don't specify the specific locale (x) this
+	   ;; gets instantiated on the stream device. Bad puppy.
+	   [cursor-font :data "top_left_arrow"]) 'global '(default x)))
     (set-glyph-image busy-pointer-glyph
 	  (or (x-get-resource "busyPointer" "Cursor" 'string device nil 'warn)
-	      "watch"))
+	      [cursor-font :data "watch"]))
     (set-glyph-image toolbar-pointer-glyph
 	  (or (x-get-resource "toolBarPointer" "Cursor" 'string device
 			      nil 'warn)
-	      "left_ptr"))
+	      [cursor-font :data "left_ptr"]))
     (set-glyph-image divider-pointer-glyph
 	  (or (x-get-resource "dividerPointer" "Cursor" 'string device
 			      nil 'warn)
-	      "sb_h_double_arrow"))
+	      [cursor-font :data "sb_h_double_arrow"]))
     (let ((fg
 	   (x-get-resource "pointerColor" "Foreground" 'string device
 			   nil 'warn)))
Index: src/glyphs-x.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.c,v
retrieving revision 1.49.2.84
diff -u -r1.49.2.84 glyphs-x.c
--- src/glyphs-x.c 2000/11/07 23:24:28 1.49.2.84
+++ src/glyphs-x.c 2000/11/28 17:12:28
@@ -2954,6 +2954,17 @@
   IIFORMAT_HAS_METHOD (autodetect, validate);
   IIFORMAT_HAS_METHOD (autodetect, normalize);
   IIFORMAT_HAS_METHOD (autodetect, possible_dest_types);
+  /* #### autodetect is flawed IMO: 
+  1. It makes the assumption that you can detect whether the user
+  wanted a cursor or a string based on the data, since the data is a
+  string you have to prioritise cursors. Instead we will force users
+  to pick the appropriate image type, this is what we do under
+  MS-Windows anyway.
+  2. It doesn't fit with the new domain model - you cannot tell which
+  domain it needs to be instantiated in until you've actually
+  instantiated it, which mucks up caching.
+  3. It only copes with cursors and strings which seems bogus. */
+  IIFORMAT_HAS_SHARED_METHOD (autodetect, governing_domain, subwindow);
   IIFORMAT_HAS_METHOD (autodetect, instantiate);
   IIFORMAT_VALID_CONSOLE (x, autodetect);
 
Index: src/gutter.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.c,v
retrieving revision 1.1.2.38
diff -u -r1.1.2.38 gutter.c
--- src/gutter.c 2000/11/07 23:24:30 1.1.2.38
+++ src/gutter.c 2000/11/28 17:12:33
@@ -218,6 +218,41 @@
     }
 }
 
+/*
+ display_boxes_in_gutter_p
+
+ Determine whether the required display_glyph_area is completely
+ inside the gutter. -1 means the display_box is not in the gutter. 1
+ means the display_box and the display_glyph_area are in the
+ window. 0 means the display_box is in the gutter but the
+ display_glyph_area is not. */
+int display_boxes_in_gutter_p (struct frame *f, struct display_box* db,
+			       struct display_glyph_area* dga)
+{
+  enum gutter_pos pos;
+  GUTTER_POS_LOOP (pos)
+    {
+      if (FRAME_GUTTER_VISIBLE (f, pos))
+	{
+	  int x, y, width, height;
+	  get_gutter_coords (f, pos, &x, &y, &width, &height);
+	  if (db->xpos + dga->xoffset >= x
+	      &&
+	      db->ypos + dga->yoffset >= y
+	      &&
+	      db->xpos + dga->xoffset + dga->width <= x + width
+	      &&
+	      db->ypos + dga->yoffset + dga->height <= y + height)
+	    return 1;
+	  else if (db->xpos >= x && db->ypos >= y
+		   && db->xpos + db->width <= x + width
+		   && db->ypos + db->height <= y + height)
+	    return 0;
+	}
+    }
+  return -1;
+}
+
 /* Convert the gutter specifier into something we can actually
    display. */
 static Lisp_Object construct_window_gutter_spec (struct window* w,
@@ -389,7 +424,8 @@
       (f->extents_changed && w->gutter_extent_modiff[pos]))
     {
 #ifdef DEBUG_GUTTERS
-      printf ("gutter redisplay triggered by %s\n", force ? "force" :
+      printf ("gutter redisplay [%dx%d@%d+%d] triggered by %s,\n", 
+	      width, height, x, y, force ? "force" :
 	      f->faces_changed ? "f->faces_changed" :
 	      f->frame_changed ? "f->frame_changed" :
 	      f->gutter_changed ? "f->gutter_changed" :
Index: src/gutter.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.h,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 gutter.h
--- src/gutter.h 2000/03/11 18:09:23 1.1.2.12
+++ src/gutter.h 2000/11/28 17:12:34
@@ -65,6 +65,8 @@
 void reset_gutter_display_lines (struct frame* f);
 void gutter_extent_signal_changed_region_maybe (Lisp_Object obj,
 						Bufpos start, Bufpos end);
+int display_boxes_in_gutter_p (struct frame *f, struct display_box* db,
+			       struct display_glyph_area* dga);
 
 #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \
   (INTP ((w)->gutter_border_width[pos]) ? XINT ((w)->gutter_border_width[pos]) : 0)
Index: src/redisplay-output.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-output.c,v
retrieving revision 1.11.2.44
diff -u -r1.11.2.44 redisplay-output.c
--- src/redisplay-output.c 2000/09/29 04:34:27 1.11.2.44
+++ src/redisplay-output.c 2000/11/28 17:12:43
@@ -40,6 +40,7 @@
 #include "glyphs.h"
 #include "redisplay.h"
 #include "faces.h"
+#include "gutter.h"
 
 static int compare_runes (struct window *w, struct rune *crb,
 			  struct rune *drb);
@@ -1263,7 +1264,12 @@
   sdga.height = IMAGE_INSTANCE_HEIGHT (p);
   sdga.width = IMAGE_INSTANCE_WIDTH (p);
 
-  if (redisplay_display_boxes_in_window_p (w, db, &sdga) < 0)
+  if (redisplay_display_boxes_in_window_p (w, db, &sdga) == 0
+      ||
+      /* We only want to do full subwindow display for windows that
+	 are completely in the gutter, otherwise we must clip to be
+	 safe. */
+      display_boxes_in_gutter_p (XFRAME (w->frame), db, &sdga) <= 0)
     {
       map_subwindow (image_instance, db->xpos, db->ypos, dga);
     }
@@ -1822,9 +1828,9 @@
 /*****************************************************************************
  redisplay_display_boxes_in_window_p
 
- Determine whether the require display_glyph_area is completely inside
- the window. 0 means the display_box is not in the window. 1 means the
- display_box and the display_glyph_area are in the window. -1 means
+ Determine whether the required display_glyph_area is completely inside
+ the window. -1 means the display_box is not in the window. 1 means the
+ display_box and the display_glyph_area are in the window. 0 means
  the display_box is in the window but the display_glyph_area is not.
  ****************************************************************************/
 static int
@@ -1840,8 +1846,8 @@
   if (db->xpos < left || db->ypos < top
       || db->xpos + db->width > right
       || db->ypos + db->height > bottom)
-    /* We are not displaying in a window at all */
-    return 0;
+      /* We are not displaying in a window at all */
+      return -1;
 
   if (db->xpos + dga->xoffset >= left
       &&
@@ -1852,7 +1858,7 @@
       db->ypos + dga->yoffset + dga->height <= bottom)
     return 1;
 
-  return -1;
+  return 0;
 }
 
 /*****************************************************************************
