emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xdisp.c,v


From: Kim F. Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c,v
Date: Tue, 05 Sep 2006 22:49:51 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kim F. Storm <kfstorm>  06/09/05 22:49:51

Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1116
retrieving revision 1.1117
diff -u -b -r1.1116 -r1.1117
--- xdisp.c     28 Aug 2006 12:03:22 -0000      1.1116
+++ xdisp.c     5 Sep 2006 22:49:51 -0000       1.1117
@@ -1272,13 +1272,12 @@
 /* Return 1 if position CHARPOS is visible in window W.
    If visible, set *X and *Y to pixel coordinates of top left corner.
    Set *RTOP and *RBOT to pixel height of an invisible area of glyph at POS.
-   EXACT_MODE_LINE_HEIGHTS_P non-zero means compute exact mode-line
-   and header-lines heights.  */
+   Set *ROWH and *VPOS to row's visible height and VPOS (row number).  */
 
 int
-pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
+pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
      struct window *w;
-     int charpos, *x, *y, *rtop, *rbot, exact_mode_line_heights_p;
+     int charpos, *x, *y, *rtop, *rbot, *rowh, *vpos;
 {
   struct it it;
   struct text_pos top;
@@ -1296,9 +1295,7 @@
 
   SET_TEXT_POS_FROM_MARKER (top, w->start);
 
-  /* Compute exact mode line heights, if requested.  */
-  if (exact_mode_line_heights_p)
-    {
+  /* Compute exact mode line heights.  */
       if (WINDOW_WANTS_MODELINE_P (w))
        current_mode_line_height
          = display_mode_line (w, CURRENT_MODE_LINE_FACE_ID (w),
@@ -1308,10 +1305,9 @@
        current_header_line_height
          = display_mode_line (w, HEADER_LINE_FACE_ID,
                               current_buffer->header_line_format);
-    }
 
   start_display (&it, w, top);
-  move_it_to (&it, charpos, -1, it.last_visible_y, -1,
+  move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
              MOVE_TO_POS | MOVE_TO_Y);
 
   /* Note that we may overshoot because of invisible text.  */
@@ -1332,6 +1328,9 @@
          *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y);
          *rtop = max (0, window_top_y - top_y);
          *rbot = max (0, bottom_y - it.last_visible_y);
+         *rowh = max (0, (min (bottom_y, it.last_visible_y)
+                          - max (top_y, window_top_y)));
+         *vpos = it.vpos;
        }
     }
   else
@@ -1350,6 +1349,11 @@
          *rtop = max (0, -it2.current_y);
          *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent)
                           - it.last_visible_y));
+         *rowh = max (0, (min (it2.current_y + it2.max_ascent + 
it2.max_descent,
+                               it.last_visible_y)
+                          - max (it2.current_y,
+                                 WINDOW_HEADER_LINE_HEIGHT (w))));
+         *vpos = it2.vpos;
        }
     }
 
@@ -1361,6 +1365,15 @@
   if (visible_p && XFASTINT (w->hscroll) > 0)
     *x -= XFASTINT (w->hscroll) * WINDOW_FRAME_COLUMN_WIDTH (w);
 
+#if 0
+  /* Debugging code.  */
+  if (visible_p)
+    fprintf (stderr, "+pv pt=%d vs=%d --> x=%d y=%d rt=%d rb=%d rh=%d vp=%d\n",
+            charpos, w->vscroll, *x, *y, *rtop, *rbot, *rowh, *vpos);
+  else
+    fprintf (stderr, "-pv pt=%d vs=%d\n", charpos, w->vscroll);
+#endif
+
   return visible_p;
 }
 
@@ -12023,7 +12036,8 @@
   window_height = window_box_height (w);
   if (row->height >= window_height)
     {
-      if (!force_p || MINI_WINDOW_P (w) || w->vscroll)
+      if (!force_p || MINI_WINDOW_P (w)
+         || w->vscroll || w->cursor.vpos == 0)
        return 1;
     }
   return 0;
@@ -13507,7 +13521,8 @@
       this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 
4);
       this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
 
-      if ((w->cursor.y < this_scroll_margin
+      if ((w->cursor.y >= 0    /* not vscrolled */
+          && w->cursor.y < this_scroll_margin
           && CHARPOS (pos) > BEGV
           && IT_CHARPOS (it) < ZV)
          /* rms: considering make_cursor_line_fully_visible_p here




reply via email to

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