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


From: Kim F . Storm
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c
Date: Fri, 12 Nov 2004 09:36:13 -0500

Index: emacs/src/xdisp.c
diff -c emacs/src/xdisp.c:1.928 emacs/src/xdisp.c:1.929
*** emacs/src/xdisp.c:1.928     Tue Nov  9 13:26:01 2004
--- emacs/src/xdisp.c   Fri Nov 12 14:27:07 2004
***************
*** 2075,2080 ****
--- 2075,2081 ----
                                  * FRAME_LINE_HEIGHT (it->f));
        else if (it->f->extra_line_spacing > 0)
        it->extra_line_spacing = it->f->extra_line_spacing;
+       it->max_extra_line_spacing = 0;
      }
  
    /* If realized faces have been removed, e.g. because of face
***************
*** 6067,6076 ****
  {
    int nlines, h;
    struct it it2, it3;
!   int start_pos = IT_CHARPOS (*it);
  
    xassert (dy >= 0);
  
    /* Estimate how many newlines we must move back.  */
    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
  
--- 6068,6080 ----
  {
    int nlines, h;
    struct it it2, it3;
!   int start_pos;
  
+  move_further_back:
    xassert (dy >= 0);
  
+   start_pos = IT_CHARPOS (*it);
+ 
    /* Estimate how many newlines we must move back.  */
    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
  
***************
*** 6136,6148 ****
             a line height of 13 pixels each, recentering with point
             on the bottom line will try to move -39/2 = 19 pixels
             backward.  Try to avoid moving into the first line.  */
!         && it->current_y - target_y > line_height / 3 * 2
          && IT_CHARPOS (*it) > BEGV)
        {
          TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",
                       target_y - it->current_y));
!         move_it_vertically (it, target_y - it->current_y);
!         xassert (IT_CHARPOS (*it) >= BEGV);
        }
        else if (target_y >= it->current_y + line_height
               && IT_CHARPOS (*it) < ZV)
--- 6140,6152 ----
             a line height of 13 pixels each, recentering with point
             on the bottom line will try to move -39/2 = 19 pixels
             backward.  Try to avoid moving into the first line.  */
!         && it->current_y - target_y > line_height * 2 / 3
          && IT_CHARPOS (*it) > BEGV)
        {
          TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",
                       target_y - it->current_y));
!         dy = it->current_y - target_y;
!         goto move_further_back;
        }
        else if (target_y >= it->current_y + line_height
               && IT_CHARPOS (*it) < ZV)
***************
*** 6183,6189 ****
  {
    if (dy <= 0)
      move_it_vertically_backward (it, -dy);
!   else if (dy > 0)
      {
        TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));
        move_it_to (it, ZV, -1, it->current_y + dy, -1,
--- 6187,6193 ----
  {
    if (dy <= 0)
      move_it_vertically_backward (it, -dy);
!   else
      {
        TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));
        move_it_to (it, ZV, -1, it->current_y + dy, -1,
***************
*** 6280,6285 ****
--- 6284,6291 ----
        /* DVPOS == 0 means move to the start of the screen line.  */
        move_it_vertically_backward (it, 0);
        xassert (it->current_x == 0 && it->hpos == 0);
+       /* Let next call to line_bottom_y calculate real line height */
+       last_height = 0;
      }
    else if (dvpos > 0)
      move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
***************
*** 7423,7429 ****
            height = it.current_y + last_height;
          else
            height = it.current_y + it.max_ascent + it.max_descent;
!         height -= it.extra_line_spacing;
          height = (height + unit - 1) / unit;
        }
  
--- 7429,7435 ----
            height = it.current_y + last_height;
          else
            height = it.current_y + it.max_ascent + it.max_descent;
!         height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
          height = (height + unit - 1) / unit;
        }
  
***************
*** 8701,8706 ****
--- 8707,8713 ----
      {
        row->height = row->phys_height = it->last_visible_y - row->y;
        row->ascent = row->phys_ascent = 0;
+       row->extra_line_spacing = 0;
      }
  
    row->full_width_p = 1;
***************
*** 10889,10895 ****
    row = MATRIX_ROW (matrix, w->cursor.vpos);
  
    /* If the cursor row is not partially visible, there's nothing to do.  */
!   if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row))
      return 1;
  
    /* If the row the cursor is in is taller than the window's height,
--- 10896,10902 ----
    row = MATRIX_ROW (matrix, w->cursor.vpos);
  
    /* If the cursor row is not partially visible, there's nothing to do.  */
!   if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
      return 1;
  
    /* If the row the cursor is in is taller than the window's height,
***************
*** 11043,11049 ****
      {
        start_display (&it, w, scroll_margin_pos);
        if (this_scroll_margin)
!       move_it_vertically (&it, - this_scroll_margin);
        if (extra_scroll_margin_lines)
        move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
        scroll_margin_pos = it.current.pos;
--- 11050,11056 ----
      {
        start_display (&it, w, scroll_margin_pos);
        if (this_scroll_margin)
!       move_it_vertically_backward (&it, this_scroll_margin);
        if (extra_scroll_margin_lines)
        move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
        scroll_margin_pos = it.current.pos;
***************
*** 11163,11169 ****
          if (amount_to_scroll <= 0)
            return SCROLLING_FAILED;
  
!         move_it_vertically (&it, - amount_to_scroll);
          startp = it.current.pos;
        }
      }
--- 11170,11176 ----
          if (amount_to_scroll <= 0)
            return SCROLLING_FAILED;
  
!         move_it_vertically_backward (&it, amount_to_scroll);
          startp = it.current.pos;
        }
      }
***************
*** 11467,11473 ****
              /* if PT is not in the glyph row, give up.  */
              rc = CURSOR_MOVEMENT_MUST_SCROLL;
            }
!         else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row))
            {
              if (PT == MATRIX_ROW_END_CHARPOS (row)
                  && !row->ends_at_zv_p
--- 11474,11480 ----
              /* if PT is not in the glyph row, give up.  */
              rc = CURSOR_MOVEMENT_MUST_SCROLL;
            }
!         else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
            {
              if (PT == MATRIX_ROW_END_CHARPOS (row)
                  && !row->ends_at_zv_p
***************
*** 12042,12048 ****
    if (it.current_y <= 0)
      {
        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
!       move_it_vertically (&it, 0);
        xassert (IT_CHARPOS (it) <= PT);
        it.current_y = 0;
      }
--- 12049,12055 ----
    if (it.current_y <= 0)
      {
        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
!       move_it_vertically_backward (&it, 0);
        xassert (IT_CHARPOS (it) <= PT);
        it.current_y = 0;
      }
***************
*** 12391,12397 ****
    /* Give up if old or new display is scrolled vertically.  We could
       make this function handle this, but right now it doesn't.  */
    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
!   if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row))
      return 0;
  
    /* The variable new_start now holds the new window start.  The old
--- 12398,12404 ----
    /* Give up if old or new display is scrolled vertically.  We could
       make this function handle this, but right now it doesn't.  */
    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
!   if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row))
      return 0;
  
    /* The variable new_start now holds the new window start.  The old
***************
*** 12439,12445 ****
              start = start_row->start.pos;
              /* If there are no more rows to try, or just one, give up.  */
              if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
!                 || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)
                  || CHARPOS (start) == ZV)
                {
                  clear_glyph_matrix (w->desired_matrix);
--- 12446,12452 ----
              start = start_row->start.pos;
              /* If there are no more rows to try, or just one, give up.  */
              if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
!                 || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
                  || CHARPOS (start) == ZV)
                {
                  clear_glyph_matrix (w->desired_matrix);
***************
*** 14233,14238 ****
--- 14240,14246 ----
          row->height = it->max_ascent + it->max_descent;
          row->phys_ascent = it->max_phys_ascent;
          row->phys_height = it->max_phys_ascent + it->max_phys_descent;
+         row->extra_line_spacing = it->max_extra_line_spacing;
        }
  
        /* Compute the width of this line.  */
***************
*** 14276,14281 ****
--- 14284,14290 ----
        row->pixel_width -= it->truncation_pixel_width;
        row->ascent = row->phys_ascent = 0;
        row->height = row->phys_height = row->visible_height = 1;
+       row->extra_line_spacing = 0;
      }
  
    /* Compute a hash code for this row.  */
***************
*** 14612,14617 ****
--- 14621,14627 ----
    row->height = it->max_ascent + it->max_descent;
    row->phys_ascent = it->max_phys_ascent;
    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
+   row->extra_line_spacing = it->max_extra_line_spacing;
  
    /* Loop generating characters.  The loop is left with IT on the next
       character to display.  */
***************
*** 14677,14682 ****
--- 14687,14694 ----
          row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
          row->phys_height = max (row->phys_height,
                                  it->max_phys_ascent + it->max_phys_descent);
+         row->extra_line_spacing = max (row->extra_line_spacing,
+                                        it->max_extra_line_spacing);
          set_iterator_to_next (it, 1);
          continue;
        }
***************
*** 14705,14710 ****
--- 14717,14724 ----
          row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
          row->phys_height = max (row->phys_height,
                                  it->max_phys_ascent + it->max_phys_descent);
+         row->extra_line_spacing = max (row->extra_line_spacing,
+                                        it->max_extra_line_spacing);
          if (it->current_x - it->pixel_width < it->first_visible_x)
            row->x = x - it->first_visible_x;
        }
***************
*** 14856,14861 ****
--- 14870,14877 ----
          row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
          row->phys_height = max (row->phys_height,
                                  it->max_phys_ascent + it->max_phys_descent);
+         row->extra_line_spacing = max (row->extra_line_spacing,
+                                        it->max_extra_line_spacing);
  
          /* End of this display line if row is continued.  */
          if (row->continued_p || row->ends_at_zv_p)
***************
*** 16767,16772 ****
--- 16783,16789 ----
    row->height = it->max_ascent + it->max_descent;
    row->phys_ascent = it->max_phys_ascent;
    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
+   row->extra_line_spacing = it->max_extra_line_spacing;
  
    /* This condition is for the case that we are called with current_x
       past last_visible_x.  */
***************
*** 16826,16831 ****
--- 16843,16850 ----
          row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
          row->phys_height = max (row->phys_height,
                                  it->max_phys_ascent + it->max_phys_descent);
+         row->extra_line_spacing = max (row->extra_line_spacing,
+                                        it->max_extra_line_spacing);
          x += glyph->pixel_width;
          ++i;
        }
***************
*** 19448,19454 ****
      it->current_x += it->pixel_width;
  
    if (extra_line_spacing > 0)
!     it->descent += extra_line_spacing;
  
    it->max_ascent = max (it->max_ascent, it->ascent);
    it->max_descent = max (it->max_descent, it->descent);
--- 19467,19477 ----
      it->current_x += it->pixel_width;
  
    if (extra_line_spacing > 0)
!     {
!       it->descent += extra_line_spacing;
!       if (extra_line_spacing > it->max_extra_line_spacing)
!       it->max_extra_line_spacing = extra_line_spacing;
!     }
  
    it->max_ascent = max (it->max_ascent, it->ascent);
    it->max_descent = max (it->max_descent, it->descent);




reply via email to

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