diff options
| author | Martin Rudalics | 2014-01-28 10:45:37 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-01-28 10:45:37 +0100 |
| commit | 1dcb169c8116b08391751ff506a755be87d42133 (patch) | |
| tree | 6a603e3fc1dc0ebb28d4abe68858190aa7871dfd /src | |
| parent | 2275de871d28dc3814caffb9779559c4ef79f58f (diff) | |
| download | emacs-1dcb169c8116b08391751ff506a755be87d42133.tar.gz emacs-1dcb169c8116b08391751ff506a755be87d42133.zip | |
Fix Fwindow_text_pixel_size and fit-frame-to-buffer.
* xdisp.c (last_max_ascent): Re-remove after erroneously
reintroducing it on 2013-11-30 and abolishing Dmitry's removal
from 2013-03-29.
(move_it_to): Re-remove reference to last_max_ascent.
(Fwindow_text_pixel_size): Add iterator's max_ascent and
max_descent here instead of calling line_bottom_y. Fix
doc-string.
* window.el (fit-frame-to-buffer): Fix calculations for margins and
height constraints.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ff3be1d7666..5fc29d30d4c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-01-28 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * xdisp.c (last_max_ascent): Re-remove after erroneously | ||
| 4 | reintroducing it on 2013-11-30 and abolishing Dmitry's removal | ||
| 5 | from 2013-03-29. | ||
| 6 | (move_it_to): Re-remove reference to last_max_ascent. | ||
| 7 | (Fwindow_text_pixel_size): Add iterator's max_ascent and | ||
| 8 | max_descent here instead of calling line_bottom_y. Fix | ||
| 9 | doc-string. | ||
| 10 | |||
| 1 | 2014-01-28 Dmitry Antipov <dmantipov@yandex.ru> | 11 | 2014-01-28 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 12 | ||
| 3 | * terminal.c (initial_free_frame_resources): New function. | 13 | * terminal.c (initial_free_frame_resources): New function. |
diff --git a/src/xdisp.c b/src/xdisp.c index 7717f1c2861..b5dec35568a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -571,7 +571,7 @@ static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS]; | |||
| 571 | 571 | ||
| 572 | /* Ascent and height of the last line processed by move_it_to. */ | 572 | /* Ascent and height of the last line processed by move_it_to. */ |
| 573 | 573 | ||
| 574 | static int last_max_ascent, last_height; | 574 | static int last_height; |
| 575 | 575 | ||
| 576 | /* Non-zero if there's a help-echo in the echo area. */ | 576 | /* Non-zero if there's a help-echo in the echo area. */ |
| 577 | 577 | ||
| @@ -9099,7 +9099,6 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos | |||
| 9099 | it->current_y += it->max_ascent + it->max_descent; | 9099 | it->current_y += it->max_ascent + it->max_descent; |
| 9100 | ++it->vpos; | 9100 | ++it->vpos; |
| 9101 | last_height = it->max_ascent + it->max_descent; | 9101 | last_height = it->max_ascent + it->max_descent; |
| 9102 | last_max_ascent = it->max_ascent; | ||
| 9103 | it->max_ascent = it->max_descent = 0; | 9102 | it->max_ascent = it->max_descent = 0; |
| 9104 | } | 9103 | } |
| 9105 | 9104 | ||
| @@ -9126,7 +9125,6 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos | |||
| 9126 | it->current_y += it->max_ascent + it->max_descent; | 9125 | it->current_y += it->max_ascent + it->max_descent; |
| 9127 | ++it->vpos; | 9126 | ++it->vpos; |
| 9128 | last_height = it->max_ascent + it->max_descent; | 9127 | last_height = it->max_ascent + it->max_descent; |
| 9129 | last_max_ascent = it->max_ascent; | ||
| 9130 | } | 9128 | } |
| 9131 | 9129 | ||
| 9132 | if (backup_data) | 9130 | if (backup_data) |
| @@ -9511,7 +9509,7 @@ Optional argument MODE_AND_HEADER_LINE nil or omitted means do not | |||
| 9511 | include the height of the mode- or header-line of WINDOW in the return | 9509 | include the height of the mode- or header-line of WINDOW in the return |
| 9512 | value. If it is either the symbol `mode-line' or `header-line', include | 9510 | value. If it is either the symbol `mode-line' or `header-line', include |
| 9513 | only the height of that line, if present, in the return value. If t, | 9511 | only the height of that line, if present, in the return value. If t, |
| 9514 | include the height of any of these lines in the return value. */) | 9512 | include the height of both, if present, in the return value. */) |
| 9515 | (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, Lisp_Object y_limit, | 9513 | (Lisp_Object window, Lisp_Object from, Lisp_Object to, Lisp_Object x_limit, Lisp_Object y_limit, |
| 9516 | Lisp_Object mode_and_header_line) | 9514 | Lisp_Object mode_and_header_line) |
| 9517 | { | 9515 | { |
| @@ -9579,7 +9577,6 @@ include the height of any of these lines in the return value. */) | |||
| 9579 | SET_TEXT_POS (startp, start, CHAR_TO_BYTE (start)); | 9577 | SET_TEXT_POS (startp, start, CHAR_TO_BYTE (start)); |
| 9580 | start_display (&it, w, startp); | 9578 | start_display (&it, w, startp); |
| 9581 | 9579 | ||
| 9582 | /** move_it_vertically_backward (&it, 0); **/ | ||
| 9583 | if (NILP (x_limit)) | 9580 | if (NILP (x_limit)) |
| 9584 | x = move_it_to (&it, end, -1, max_y, -1, MOVE_TO_POS | MOVE_TO_Y); | 9581 | x = move_it_to (&it, end, -1, max_y, -1, MOVE_TO_POS | MOVE_TO_Y); |
| 9585 | else | 9582 | else |
| @@ -9593,14 +9590,7 @@ include the height of any of these lines in the return value. */) | |||
| 9593 | MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); | 9590 | MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); |
| 9594 | } | 9591 | } |
| 9595 | 9592 | ||
| 9596 | if (start == end) | 9593 | y = it.current_y + it.max_ascent + it.max_descent; |
| 9597 | y = it.current_y; | ||
| 9598 | else | ||
| 9599 | { | ||
| 9600 | /* Count last line. */ | ||
| 9601 | last_height = 0; | ||
| 9602 | y = line_bottom_y (&it); /* - y; */ | ||
| 9603 | } | ||
| 9604 | 9594 | ||
| 9605 | if (!EQ (mode_and_header_line, Qheader_line) | 9595 | if (!EQ (mode_and_header_line, Qheader_line) |
| 9606 | && !EQ (mode_and_header_line, Qt)) | 9596 | && !EQ (mode_and_header_line, Qt)) |