aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-11-12 14:27:07 +0000
committerKim F. Storm2004-11-12 14:27:07 +0000
commit546f98b8385d2c264c845e6dc773dbdfb2199b64 (patch)
tree1f4436559c359075b990c81ccf0b003db2c800c2 /src
parentf204989e2e4cfb5d3744c30efe3ef408fa80fe08 (diff)
downloademacs-546f98b8385d2c264c845e6dc773dbdfb2199b64.tar.gz
emacs-546f98b8385d2c264c845e6dc773dbdfb2199b64.zip
(init_iterator): Clear it.max_extra_line_spacing.
(move_it_vertically_backward): Don't recure to move further back. (move_it_vertically): Remove superfluous condition. (move_it_by_lines): Clear last_height when moved 0 lines. (resize_mini_window): use it.max_extra_line_spacing. (display_tool_bar_line): Clear row->extra_line_spacing. (try_scrolling): Use move_it_vertically_backward directly. (redisplay_window): Likewise. (compute_line_metrics): Set row->extra_line_spacing. (display_line, display_string): Likewise. (x_produce_glyphs): Update it->max_extra_line_spacing.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c51
1 files changed, 37 insertions, 14 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index e953771b1cf..614bb898ed8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2075,6 +2075,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
2075 * FRAME_LINE_HEIGHT (it->f)); 2075 * FRAME_LINE_HEIGHT (it->f));
2076 else if (it->f->extra_line_spacing > 0) 2076 else if (it->f->extra_line_spacing > 0)
2077 it->extra_line_spacing = it->f->extra_line_spacing; 2077 it->extra_line_spacing = it->f->extra_line_spacing;
2078 it->max_extra_line_spacing = 0;
2078 } 2079 }
2079 2080
2080 /* If realized faces have been removed, e.g. because of face 2081 /* If realized faces have been removed, e.g. because of face
@@ -6067,10 +6068,13 @@ move_it_vertically_backward (it, dy)
6067{ 6068{
6068 int nlines, h; 6069 int nlines, h;
6069 struct it it2, it3; 6070 struct it it2, it3;
6070 int start_pos = IT_CHARPOS (*it); 6071 int start_pos;
6071 6072
6073 move_further_back:
6072 xassert (dy >= 0); 6074 xassert (dy >= 0);
6073 6075
6076 start_pos = IT_CHARPOS (*it);
6077
6074 /* Estimate how many newlines we must move back. */ 6078 /* Estimate how many newlines we must move back. */
6075 nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f)); 6079 nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
6076 6080
@@ -6136,13 +6140,13 @@ move_it_vertically_backward (it, dy)
6136 a line height of 13 pixels each, recentering with point 6140 a line height of 13 pixels each, recentering with point
6137 on the bottom line will try to move -39/2 = 19 pixels 6141 on the bottom line will try to move -39/2 = 19 pixels
6138 backward. Try to avoid moving into the first line. */ 6142 backward. Try to avoid moving into the first line. */
6139 && it->current_y - target_y > line_height / 3 * 2 6143 && it->current_y - target_y > line_height * 2 / 3
6140 && IT_CHARPOS (*it) > BEGV) 6144 && IT_CHARPOS (*it) > BEGV)
6141 { 6145 {
6142 TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n", 6146 TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n",
6143 target_y - it->current_y)); 6147 target_y - it->current_y));
6144 move_it_vertically (it, target_y - it->current_y); 6148 dy = it->current_y - target_y;
6145 xassert (IT_CHARPOS (*it) >= BEGV); 6149 goto move_further_back;
6146 } 6150 }
6147 else if (target_y >= it->current_y + line_height 6151 else if (target_y >= it->current_y + line_height
6148 && IT_CHARPOS (*it) < ZV) 6152 && IT_CHARPOS (*it) < ZV)
@@ -6183,7 +6187,7 @@ move_it_vertically (it, dy)
6183{ 6187{
6184 if (dy <= 0) 6188 if (dy <= 0)
6185 move_it_vertically_backward (it, -dy); 6189 move_it_vertically_backward (it, -dy);
6186 else if (dy > 0) 6190 else
6187 { 6191 {
6188 TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy)); 6192 TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));
6189 move_it_to (it, ZV, -1, it->current_y + dy, -1, 6193 move_it_to (it, ZV, -1, it->current_y + dy, -1,
@@ -6280,6 +6284,8 @@ move_it_by_lines (it, dvpos, need_y_p)
6280 /* DVPOS == 0 means move to the start of the screen line. */ 6284 /* DVPOS == 0 means move to the start of the screen line. */
6281 move_it_vertically_backward (it, 0); 6285 move_it_vertically_backward (it, 0);
6282 xassert (it->current_x == 0 && it->hpos == 0); 6286 xassert (it->current_x == 0 && it->hpos == 0);
6287 /* Let next call to line_bottom_y calculate real line height */
6288 last_height = 0;
6283 } 6289 }
6284 else if (dvpos > 0) 6290 else if (dvpos > 0)
6285 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); 6291 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
@@ -7423,7 +7429,7 @@ resize_mini_window (w, exact_p)
7423 height = it.current_y + last_height; 7429 height = it.current_y + last_height;
7424 else 7430 else
7425 height = it.current_y + it.max_ascent + it.max_descent; 7431 height = it.current_y + it.max_ascent + it.max_descent;
7426 height -= it.extra_line_spacing; 7432 height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
7427 height = (height + unit - 1) / unit; 7433 height = (height + unit - 1) / unit;
7428 } 7434 }
7429 7435
@@ -8701,6 +8707,7 @@ display_tool_bar_line (it)
8701 { 8707 {
8702 row->height = row->phys_height = it->last_visible_y - row->y; 8708 row->height = row->phys_height = it->last_visible_y - row->y;
8703 row->ascent = row->phys_ascent = 0; 8709 row->ascent = row->phys_ascent = 0;
8710 row->extra_line_spacing = 0;
8704 } 8711 }
8705 8712
8706 row->full_width_p = 1; 8713 row->full_width_p = 1;
@@ -10889,7 +10896,7 @@ make_cursor_line_fully_visible (w, force_p)
10889 row = MATRIX_ROW (matrix, w->cursor.vpos); 10896 row = MATRIX_ROW (matrix, w->cursor.vpos);
10890 10897
10891 /* If the cursor row is not partially visible, there's nothing to do. */ 10898 /* If the cursor row is not partially visible, there's nothing to do. */
10892 if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) 10899 if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
10893 return 1; 10900 return 1;
10894 10901
10895 /* If the row the cursor is in is taller than the window's height, 10902 /* If the row the cursor is in is taller than the window's height,
@@ -11043,7 +11050,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
11043 { 11050 {
11044 start_display (&it, w, scroll_margin_pos); 11051 start_display (&it, w, scroll_margin_pos);
11045 if (this_scroll_margin) 11052 if (this_scroll_margin)
11046 move_it_vertically (&it, - this_scroll_margin); 11053 move_it_vertically_backward (&it, this_scroll_margin);
11047 if (extra_scroll_margin_lines) 11054 if (extra_scroll_margin_lines)
11048 move_it_by_lines (&it, - extra_scroll_margin_lines, 0); 11055 move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
11049 scroll_margin_pos = it.current.pos; 11056 scroll_margin_pos = it.current.pos;
@@ -11163,7 +11170,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
11163 if (amount_to_scroll <= 0) 11170 if (amount_to_scroll <= 0)
11164 return SCROLLING_FAILED; 11171 return SCROLLING_FAILED;
11165 11172
11166 move_it_vertically (&it, - amount_to_scroll); 11173 move_it_vertically_backward (&it, amount_to_scroll);
11167 startp = it.current.pos; 11174 startp = it.current.pos;
11168 } 11175 }
11169 } 11176 }
@@ -11467,7 +11474,7 @@ try_cursor_movement (window, startp, scroll_step)
11467 /* if PT is not in the glyph row, give up. */ 11474 /* if PT is not in the glyph row, give up. */
11468 rc = CURSOR_MOVEMENT_MUST_SCROLL; 11475 rc = CURSOR_MOVEMENT_MUST_SCROLL;
11469 } 11476 }
11470 else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) 11477 else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
11471 { 11478 {
11472 if (PT == MATRIX_ROW_END_CHARPOS (row) 11479 if (PT == MATRIX_ROW_END_CHARPOS (row)
11473 && !row->ends_at_zv_p 11480 && !row->ends_at_zv_p
@@ -12042,7 +12049,7 @@ redisplay_window (window, just_this_one_p)
12042 if (it.current_y <= 0) 12049 if (it.current_y <= 0)
12043 { 12050 {
12044 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); 12051 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
12045 move_it_vertically (&it, 0); 12052 move_it_vertically_backward (&it, 0);
12046 xassert (IT_CHARPOS (it) <= PT); 12053 xassert (IT_CHARPOS (it) <= PT);
12047 it.current_y = 0; 12054 it.current_y = 0;
12048 } 12055 }
@@ -12391,7 +12398,7 @@ try_window_reusing_current_matrix (w)
12391 /* Give up if old or new display is scrolled vertically. We could 12398 /* Give up if old or new display is scrolled vertically. We could
12392 make this function handle this, but right now it doesn't. */ 12399 make this function handle this, but right now it doesn't. */
12393 start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); 12400 start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
12394 if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)) 12401 if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row))
12395 return 0; 12402 return 0;
12396 12403
12397 /* The variable new_start now holds the new window start. The old 12404 /* The variable new_start now holds the new window start. The old
@@ -12439,7 +12446,7 @@ try_window_reusing_current_matrix (w)
12439 start = start_row->start.pos; 12446 start = start_row->start.pos;
12440 /* If there are no more rows to try, or just one, give up. */ 12447 /* If there are no more rows to try, or just one, give up. */
12441 if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1 12448 if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
12442 || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row) 12449 || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
12443 || CHARPOS (start) == ZV) 12450 || CHARPOS (start) == ZV)
12444 { 12451 {
12445 clear_glyph_matrix (w->desired_matrix); 12452 clear_glyph_matrix (w->desired_matrix);
@@ -14233,6 +14240,7 @@ compute_line_metrics (it)
14233 row->height = it->max_ascent + it->max_descent; 14240 row->height = it->max_ascent + it->max_descent;
14234 row->phys_ascent = it->max_phys_ascent; 14241 row->phys_ascent = it->max_phys_ascent;
14235 row->phys_height = it->max_phys_ascent + it->max_phys_descent; 14242 row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14243 row->extra_line_spacing = it->max_extra_line_spacing;
14236 } 14244 }
14237 14245
14238 /* Compute the width of this line. */ 14246 /* Compute the width of this line. */
@@ -14276,6 +14284,7 @@ compute_line_metrics (it)
14276 row->pixel_width -= it->truncation_pixel_width; 14284 row->pixel_width -= it->truncation_pixel_width;
14277 row->ascent = row->phys_ascent = 0; 14285 row->ascent = row->phys_ascent = 0;
14278 row->height = row->phys_height = row->visible_height = 1; 14286 row->height = row->phys_height = row->visible_height = 1;
14287 row->extra_line_spacing = 0;
14279 } 14288 }
14280 14289
14281 /* Compute a hash code for this row. */ 14290 /* Compute a hash code for this row. */
@@ -14612,6 +14621,7 @@ display_line (it)
14612 row->height = it->max_ascent + it->max_descent; 14621 row->height = it->max_ascent + it->max_descent;
14613 row->phys_ascent = it->max_phys_ascent; 14622 row->phys_ascent = it->max_phys_ascent;
14614 row->phys_height = it->max_phys_ascent + it->max_phys_descent; 14623 row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14624 row->extra_line_spacing = it->max_extra_line_spacing;
14615 14625
14616 /* Loop generating characters. The loop is left with IT on the next 14626 /* Loop generating characters. The loop is left with IT on the next
14617 character to display. */ 14627 character to display. */
@@ -14677,6 +14687,8 @@ display_line (it)
14677 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); 14687 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14678 row->phys_height = max (row->phys_height, 14688 row->phys_height = max (row->phys_height,
14679 it->max_phys_ascent + it->max_phys_descent); 14689 it->max_phys_ascent + it->max_phys_descent);
14690 row->extra_line_spacing = max (row->extra_line_spacing,
14691 it->max_extra_line_spacing);
14680 set_iterator_to_next (it, 1); 14692 set_iterator_to_next (it, 1);
14681 continue; 14693 continue;
14682 } 14694 }
@@ -14705,6 +14717,8 @@ display_line (it)
14705 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); 14717 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14706 row->phys_height = max (row->phys_height, 14718 row->phys_height = max (row->phys_height,
14707 it->max_phys_ascent + it->max_phys_descent); 14719 it->max_phys_ascent + it->max_phys_descent);
14720 row->extra_line_spacing = max (row->extra_line_spacing,
14721 it->max_extra_line_spacing);
14708 if (it->current_x - it->pixel_width < it->first_visible_x) 14722 if (it->current_x - it->pixel_width < it->first_visible_x)
14709 row->x = x - it->first_visible_x; 14723 row->x = x - it->first_visible_x;
14710 } 14724 }
@@ -14856,6 +14870,8 @@ display_line (it)
14856 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); 14870 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14857 row->phys_height = max (row->phys_height, 14871 row->phys_height = max (row->phys_height,
14858 it->max_phys_ascent + it->max_phys_descent); 14872 it->max_phys_ascent + it->max_phys_descent);
14873 row->extra_line_spacing = max (row->extra_line_spacing,
14874 it->max_extra_line_spacing);
14859 14875
14860 /* End of this display line if row is continued. */ 14876 /* End of this display line if row is continued. */
14861 if (row->continued_p || row->ends_at_zv_p) 14877 if (row->continued_p || row->ends_at_zv_p)
@@ -16767,6 +16783,7 @@ display_string (string, lisp_string, face_string, face_string_pos,
16767 row->height = it->max_ascent + it->max_descent; 16783 row->height = it->max_ascent + it->max_descent;
16768 row->phys_ascent = it->max_phys_ascent; 16784 row->phys_ascent = it->max_phys_ascent;
16769 row->phys_height = it->max_phys_ascent + it->max_phys_descent; 16785 row->phys_height = it->max_phys_ascent + it->max_phys_descent;
16786 row->extra_line_spacing = it->max_extra_line_spacing;
16770 16787
16771 /* This condition is for the case that we are called with current_x 16788 /* This condition is for the case that we are called with current_x
16772 past last_visible_x. */ 16789 past last_visible_x. */
@@ -16826,6 +16843,8 @@ display_string (string, lisp_string, face_string, face_string_pos,
16826 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); 16843 row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
16827 row->phys_height = max (row->phys_height, 16844 row->phys_height = max (row->phys_height,
16828 it->max_phys_ascent + it->max_phys_descent); 16845 it->max_phys_ascent + it->max_phys_descent);
16846 row->extra_line_spacing = max (row->extra_line_spacing,
16847 it->max_extra_line_spacing);
16829 x += glyph->pixel_width; 16848 x += glyph->pixel_width;
16830 ++i; 16849 ++i;
16831 } 16850 }
@@ -19448,7 +19467,11 @@ x_produce_glyphs (it)
19448 it->current_x += it->pixel_width; 19467 it->current_x += it->pixel_width;
19449 19468
19450 if (extra_line_spacing > 0) 19469 if (extra_line_spacing > 0)
19451 it->descent += extra_line_spacing; 19470 {
19471 it->descent += extra_line_spacing;
19472 if (extra_line_spacing > it->max_extra_line_spacing)
19473 it->max_extra_line_spacing = extra_line_spacing;
19474 }
19452 19475
19453 it->max_ascent = max (it->max_ascent, it->ascent); 19476 it->max_ascent = max (it->max_ascent, it->ascent);
19454 it->max_descent = max (it->max_descent, it->descent); 19477 it->max_descent = max (it->max_descent, it->descent);