emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/window.c


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/window.c
Date: Fri, 21 Jan 2005 20:41:48 -0500

Index: emacs/src/window.c
diff -c emacs/src/window.c:1.491 emacs/src/window.c:1.492
*** emacs/src/window.c:1.491    Tue Jan  4 03:00:21 2005
--- emacs/src/window.c  Sat Jan 22 01:41:47 2005
***************
*** 124,129 ****
--- 124,134 ----
  
  Lisp_Object Vtemp_buffer_show_function;
  
+ /* Non-zero means line and page scrolling on tall lines (with images)
+    does partial scrolling by modifying window-vscroll.  */
+ 
+ int auto_window_vscroll_p;
+ 
  /* Non-zero means to use mode-line-inactive face in all windows but the
     selected-window and the minibuffer-scroll-window when the
     minibuffer is active.  */
***************
*** 328,336 ****
  POS defaults to point in WINDOW; WINDOW defaults to the selected window.
  
  If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
! return value is a list (X Y FULLY) where X and Y are the pixel coordinates
! relative to the top left corner of the window, and FULLY is t if the
! character after POS is fully visible and nil otherwise.  */)
       (pos, window, partially)
       Lisp_Object pos, window, partially;
  {
--- 333,343 ----
  POS defaults to point in WINDOW; WINDOW defaults to the selected window.
  
  If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
! return value is a list (X Y FULLY [RTOP RBOT]) where X and Y are the pixel
! coordinates relative to the top left corner of the window, and FULLY is t if 
the
! character after POS is fully visible and nil otherwise.  If FULLY is nil,
! RTOP and RBOT are the number of pixels invisible at the top and bottom row
! of the window.  */)
       (pos, window, partially)
       Lisp_Object pos, window, partially;
  {
***************
*** 339,345 ****
    register struct buffer *buf;
    struct text_pos top;
    Lisp_Object in_window = Qnil;
!   int fully_p = 1;
    int x, y;
  
    w = decode_window (window);
--- 346,352 ----
    register struct buffer *buf;
    struct text_pos top;
    Lisp_Object in_window = Qnil;
!   int rtop, rbot, fully_p = 1;
    int x, y;
  
    w = decode_window (window);
***************
*** 362,375 ****
        && posint <= BUF_ZV (buf)
        && CHARPOS (top) >= BUF_BEGV (buf)
        && CHARPOS (top) <= BUF_ZV (buf)
!       && pos_visible_p (w, posint, &fully_p, &x, &y, NILP (partially))
!       && (!NILP (partially) || fully_p))
      in_window = Qt;
  
    if (!NILP (in_window) && !NILP (partially))
      in_window = Fcons (make_number (x),
                       Fcons (make_number (y),
!                             Fcons (fully_p ? Qt : Qnil, Qnil)));
    return in_window;
  }
  
--- 369,387 ----
        && posint <= BUF_ZV (buf)
        && CHARPOS (top) >= BUF_BEGV (buf)
        && CHARPOS (top) <= BUF_ZV (buf)
!       && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, NILP (partially))
!       && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p)))
      in_window = Qt;
  
    if (!NILP (in_window) && !NILP (partially))
      in_window = Fcons (make_number (x),
                       Fcons (make_number (y),
!                             Fcons (fully_p ? Qt : Qnil,
!                                    (fully_p
!                                     ? Qnil
!                                     : Fcons (make_number (rtop),
!                                              Fcons (make_number (rbot),
!                                                     Qnil))))));
    return in_window;
  }
  
***************
*** 4564,4569 ****
--- 4576,4606 ----
  
        start = it.current.pos;
      }
+   else if (auto_window_vscroll_p)
+     {
+       if (NILP (XCAR (XCDR (XCDR (tem)))))
+       {
+         int px;
+         int dy = WINDOW_FRAME_LINE_HEIGHT (w);
+         if (whole)
+           dy = window_box_height (w) - next_screen_context_lines * dy;
+         dy *= n;
+ 
+         if (n < 0 && (px = XINT (Fnth (make_number (3), tem))) > 0)
+           {
+             px = max (0, -w->vscroll - min (px, -dy));
+             Fset_window_vscroll (window, make_number (px), Qt);
+             return;
+           }
+         if (n > 0 && (px = XINT (Fnth (make_number (4), tem))) > 0)
+           {
+             px = max (0, -w->vscroll + min (px, dy));
+             Fset_window_vscroll (window, make_number (px), Qt);
+             return;
+           }
+       }
+       Fset_window_vscroll (window, make_number (0), Qt);
+     }
  
    /* If scroll_preserve_screen_position is non-nil, we try to set
       point in the same window line as it is now, so get that line.  */
***************
*** 6335,6347 ****
                      : XFLOATINT (vscroll));
        w->vscroll = min (w->vscroll, 0);
  
!       /* Adjust glyph matrix of the frame if the virtual display
!        area becomes larger than before.  */
!       if (w->vscroll < 0 && w->vscroll < old_dy)
!       adjust_glyphs (f);
  
!       /* Prevent redisplay shortcuts.  */
!       XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
      }
  
    return Fwindow_vscroll (window, pixels_p);
--- 6372,6387 ----
                      : XFLOATINT (vscroll));
        w->vscroll = min (w->vscroll, 0);
  
!       if (w->vscroll != old_dy)
!       {
!         /* Adjust glyph matrix of the frame if the virtual display
!            area becomes larger than before.  */
!         if (w->vscroll < 0 && w->vscroll < old_dy)
!           adjust_glyphs (f);
  
!         /* Prevent redisplay shortcuts.  */
!         XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
!       }
      }
  
    return Fwindow_vscroll (window, pixels_p);
***************
*** 6653,6658 ****
--- 6693,6702 ----
               doc: /* *Non-nil means `display-buffer' should make a separate 
frame.  */);
    pop_up_frames = 0;
  
+   DEFVAR_BOOL ("auto-window-vscroll", &auto_window_vscroll_p,
+              doc: /* *Non-nil means to automatically adjust `window-vscroll' 
to view tall lines.  */);
+   auto_window_vscroll_p = 1;
+ 
    DEFVAR_BOOL ("display-buffer-reuse-frames", &display_buffer_reuse_frames,
               doc: /* *Non-nil means `display-buffer' should reuse frames.
  If the buffer in question is already displayed in a frame, raise that frame.  
*/);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]