Index: lisp/gutter-items.el =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/Attic/gutter-items.el,v retrieving revision 1.1.2.17 diff -u -r1.1.2.17 gutter-items.el --- lisp/gutter-items.el 1999/09/20 10:48:26 1.1.2.17 +++ lisp/gutter-items.el 1999/09/22 16:16:26 @@ -250,7 +250,7 @@ (let ((inst (glyph-image-instance gutter-buffers-tab (when (framep frame-or-buffer) - (frame-selected-window frame-or-buffer))))) + (last-nonminibuf-window frame-or-buffer))))) (set-image-instance-property inst :items (buffers-tab-items nil locale)) Index: lwlib/lwlib-Xm.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/lwlib/lwlib-Xm.c,v retrieving revision 1.11.2.10 diff -u -r1.11.2.10 lwlib-Xm.c --- lwlib/lwlib-Xm.c 1999/08/31 09:04:42 1.11.2.10 +++ lwlib/lwlib-Xm.c 1999/09/22 16:16:32 @@ -208,6 +208,14 @@ XmString name_string = NULL; Arg al [20]; int ac = 0; + int type; + + /* Don't clobber pixmap types. */ + XtSetArg (al [0], XmNlabelType, &type); + XtGetValues (widget, al, 1); + + if (type == XmPIXMAP) + return; if (val->value) { Index: src/glyphs-x.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-x.c,v retrieving revision 1.49.2.27 diff -u -r1.49.2.27 glyphs-x.c --- src/glyphs-x.c 1999/09/20 12:15:49 1.49.2.27 +++ src/glyphs-x.c 1999/09/22 16:17:15 @@ -2217,6 +2217,14 @@ else /* must be a widget */ { Arg al[2]; + + if (!XtIsRealized (IMAGE_INSTANCE_X_WIDGET_ID (ii))) + { + Lisp_Object sw; + XSETIMAGE_INSTANCE (sw, ii); + signal_simple_error ("XEmacs bug: subwindow is not realized", sw); + } + XtSetArg (al [0], XtNwidth, (Dimension)w); XtSetArg (al [1], XtNheight, (Dimension)h); XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 2); Index: src/glyphs.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs.c,v retrieving revision 1.23.2.26 diff -u -r1.23.2.26 glyphs.c --- src/glyphs.c 1999/09/20 10:48:30 1.23.2.26 +++ src/glyphs.c 1999/09/22 16:17:23 @@ -3773,8 +3773,10 @@ if (!NILP (cachel->subwindow) && cachel->being_displayed) { - struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (cachel->subwindow); - MAYBE_DEVMETH (XDEVICE (f->device), unmap_subwindow, (ii)); + cachel->updated = 1; + /* #### This is not optimal as update_subwindow will search + the cachels for ourselves as well. We could easily optimize. */ + unmap_subwindow (cachel->subwindow); } } Dynarr_reset (f->subwindow_cachels); @@ -3987,7 +3989,9 @@ return; #ifdef DEBUG_WIDGETS - stderr_out ("mapping subwindow %d\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii)); + stderr_out ("mapping subwindow %d, %dx%d@%d+%d\n", + IMAGE_INSTANCE_SUBWINDOW_ID (ii), + dga->width, dga->height, x, y); #endif f = XFRAME (IMAGE_INSTANCE_SUBWINDOW_FRAME (ii)); IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1; Index: src/gutter.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.c,v retrieving revision 1.1.2.9 diff -u -r1.1.2.9 gutter.c --- src/gutter.c 1999/08/31 17:38:24 1.1.2.9 +++ src/gutter.c 1999/09/22 16:17:24 @@ -351,6 +351,13 @@ f->gutter_changed = 0; } +void +reset_gutter_display_lines (struct frame* f) +{ + if (f->current_display_lines) + Dynarr_reset (f->current_display_lines); +} + static void redraw_exposed_gutter (struct frame *f, enum gutter_pos pos, int x, int y, int width, int height) @@ -367,8 +374,7 @@ /* #### optimize this - redrawing the whole gutter for every expose is very expensive. We reset the current display lines because if they're being exposed they are no longer current. */ - if (f->current_display_lines) - Dynarr_reset (f->current_display_lines); + reset_gutter_display_lines (f); /* Even if none of the gutter is in the area, the blank region at the very least must be because the first thing we did is verify Index: src/gutter.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.h,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 gutter.h --- src/gutter.h 1999/07/19 11:04:13 1.1.2.2 +++ src/gutter.h 1999/09/22 16:17:26 @@ -57,6 +57,7 @@ void free_frame_gutters (struct frame *f); void redraw_exposed_gutters (struct frame *f, int x, int y, int width, int height); +void reset_gutter_display_lines (struct frame* f); #define WINDOW_GUTTER_BORDER_WIDTH(w, pos) \ (NILP ((w)->gutter_border_width[pos]) ? 0 : XINT ((w)->gutter_border_width[pos])) Index: src/redisplay.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v retrieving revision 1.55.2.13 diff -u -r1.55.2.13 redisplay.c --- src/redisplay.c 1999/09/14 06:51:02 1.55.2.13 +++ src/redisplay.c 1999/09/22 16:17:41 @@ -4739,27 +4739,10 @@ } else if (data.bi_bufpos == bi_string_zv) { - /* We need to add a marker to the end of the line since there is no - newline character in order for the cursor to get drawn. We label - it as a newline so that it gets handled correctly by the - whitespace routines below. */ - - data.ch = '\n'; - data.blank_width = DEVMETH (d, eol_cursor_width, ()); - data.findex = default_face; - data.start_col = 0; - data.bi_start_col_enabled = 0; - - data.max_pixpos += data.blank_width; - add_emchar_rune (&data); - data.max_pixpos -= data.blank_width; - - /* #### urk! Chuck, this shit is bad news. Going around - manipulating invalid positions is guaranteed to result in - trouble sooner or later. */ - data.bi_bufpos = bi_string_zv + 1; + /* create_text_block () adds a bogus \n marker here which screws + up subwindow display. Since we never have a cursor in the + gutter we can safely ignore it. */ } - /* Calculate left whitespace boundary. */ { int elt = 0; @@ -6317,7 +6300,11 @@ if (!Dynarr_length (f->subwindow_cachels) || f->glyphs_changed || f->frame_changed) - reset_subwindow_cachels (f); + { + reset_subwindow_cachels (f); + /* we have to do this so the gutter gets regenerated. */ + reset_gutter_display_lines (f); + } else mark_subwindow_cachels_as_not_updated (f); /* We can now update the gutters, safe in the knowledge that our Index: src/window.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/window.c,v retrieving revision 1.41.2.16 diff -u -r1.41.2.16 window.c --- src/window.c 1999/09/14 06:51:04 1.41.2.16 +++ src/window.c 1999/09/22 16:17:55 @@ -85,6 +85,9 @@ /* Spacing between outer egde of divider border and window edge */ Lisp_Object Vvertical_divider_spacing; +/* How much to scroll by per-line. */ +Lisp_Object Vwindow_pixel_scroll_increment; + /* Scroll if point lands on the bottom line and that line is partially clipped. */ int scroll_on_clipped_lines; @@ -1096,6 +1099,26 @@ } } +DEFUN ("last-nonminibuf-window", Flast_nonminibuf_window, 0, 1, 0, /* +Return the last selected window that is not a minibuffer window. +If the optional argument CON-DEV-OR-FRAME is specified and is a frame, +return the last non-minibuffer window used by that frame. If +CON-DEV-OR-FRAME is a device, then the selected frame on that device +will be used. If CON-DEV-OR-FRAME is a console, the selected frame on +that console's selected device will be used. Otherwise, the selected +frame is used. +*/ + (con_dev_or_frame)) +{ + if (NILP (con_dev_or_frame) && NILP (Fselected_device (Qnil))) + return Qnil; /* happens at startup */ + + { + struct frame *f = decode_frame_or_selected (con_dev_or_frame); + return FRAME_LAST_NONMINIBUF_WINDOW (f); + } +} + DEFUN ("minibuffer-window", Fminibuffer_window, 0, 1, 0, /* Return the window used now for minibuffers. If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return @@ -4000,7 +4023,11 @@ /* Determine parameters to test for partial line scrolling with. */ dla = window_display_lines (w, CURRENT_DISP); - default_face_height_and_width (window, &fheight, &fwidth); + + if (INTP (Vwindow_pixel_scroll_increment)) + fheight = XINT (Vwindow_pixel_scroll_increment); + else if (!NILP (Vwindow_pixel_scroll_increment)); + default_face_height_and_width (window, &fheight, &fwidth); if (Dynarr_length (dla) >= 1) modeline = Dynarr_atp (dla, 0)->modeline; @@ -4012,8 +4039,10 @@ /* Go for partial display line scrolling. This just means bumping the clip by a reasonable amount and redisplaying, everything else remains unchanged. */ - if (Dynarr_length (dla) >= (1 + modeline) + if (!NILP (Vwindow_pixel_scroll_increment) && + Dynarr_length (dla) >= (1 + modeline) + && (dl->ascent - dl->top_clip) - fheight * value > 0) { WINDOW_TEXT_TOP_CLIP (w) += value * fheight; @@ -4065,7 +4094,9 @@ /* Go for partial display line scrolling. This just means bumping the clip by a reasonable amount and redisplaying, everything else remains unchanged. */ - if (Dynarr_length (dla) >= (1 + modeline) + if (!NILP (Vwindow_pixel_scroll_increment) + && + Dynarr_length (dla) >= (1 + modeline) && (dl->ascent - dl->top_clip) - fheight * value < (dl->ascent + dl->descent - dl->clip) @@ -5665,6 +5696,7 @@ #endif DEFSUBR (Fselected_window); + DEFSUBR (Flast_nonminibuf_window); DEFSUBR (Fminibuffer_window); DEFSUBR (Fwindow_minibuffer_p); DEFSUBR (Fwindowp); @@ -5781,6 +5813,13 @@ If non-nil, this is a buffer and \\[scroll-other-window] should scroll its window. */ ); Vother_window_scroll_buffer = Qnil; + + DEFVAR_LISP ("window-pixel-scroll-increment", &Vwindow_pixel_scroll_increment /* +*Number of pixels to scroll by per requested line. +If nil then normal line scrolling occurs regardless of line height. +If t then scrolling is done in increments equal to the height of the default face. +*/ ); + Vwindow_pixel_scroll_increment = Qt; DEFVAR_INT ("next-screen-context-lines", &next_screen_context_lines /* *Number of lines of continuity when scrolling by screenfuls.