diff options
| author | Gerd Moellmann | 2000-08-10 19:14:59 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-08-10 19:14:59 +0000 |
| commit | cbc099e58429f712b1f88c1ee9b85457ce6e6c0e (patch) | |
| tree | 7c4ef99ddce4344952ba3bb70d9d5065d77ce539 /src | |
| parent | 92f424dfc0fa8a5943c6072fce1d3ddefb87880d (diff) | |
| download | emacs-cbc099e58429f712b1f88c1ee9b85457ce6e6c0e.tar.gz emacs-cbc099e58429f712b1f88c1ee9b85457ce6e6c0e.zip | |
(Fwindow_end): Rewritten to not use Fvertical_motion,
because that function doesn't cope with variable-height lines.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/window.c b/src/window.c index 6dbe93be67e..b375d9b69f8 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -783,29 +783,29 @@ if it isn't already recorded.") | |||
| 783 | && ! (! NILP (w->window_end_valid) | 783 | && ! (! NILP (w->window_end_valid) |
| 784 | && XFASTINT (w->last_modified) >= MODIFF)) | 784 | && XFASTINT (w->last_modified) >= MODIFF)) |
| 785 | { | 785 | { |
| 786 | int opoint = PT, opoint_byte = PT_BYTE; | 786 | struct text_pos startp; |
| 787 | struct it it; | ||
| 787 | 788 | ||
| 788 | /* In case W->start is out of the range, use something | 789 | /* In case W->start is out of the range, use something |
| 789 | reasonable. This situation occured when loading a file with | 790 | reasonable. This situation occured when loading a file with |
| 790 | `-l' containing a call to `rmail' with subsequent other | 791 | `-l' containing a call to `rmail' with subsequent other |
| 791 | commands. At the end, W->start happened to be BEG, while | 792 | commands. At the end, W->start happened to be BEG, while |
| 792 | rmail had already narrowed the buffer. This leads to an | 793 | rmail had already narrowed the buffer. */ |
| 793 | abort in temp_set_pt_both. */ | ||
| 794 | if (XMARKER (w->start)->charpos < BEGV) | 794 | if (XMARKER (w->start)->charpos < BEGV) |
| 795 | TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); | 795 | SET_TEXT_POS (startp, BEGV, BEGV_BYTE); |
| 796 | else if (XMARKER (w->start)->charpos > ZV) | 796 | else if (XMARKER (w->start)->charpos > ZV) |
| 797 | TEMP_SET_PT_BOTH (ZV, ZV_BYTE); | 797 | SET_TEXT_POS (startp, ZV, ZV_BYTE); |
| 798 | else | 798 | else |
| 799 | TEMP_SET_PT_BOTH (XMARKER (w->start)->charpos, | 799 | SET_TEXT_POS_FROM_MARKER (startp, w->start); |
| 800 | XMARKER (w->start)->bytepos); | 800 | |
| 801 | 801 | /* Cannot use Fvertical_motion because that function doesn't | |
| 802 | Fvertical_motion (make_number (window_internal_height (w)), Qnil); | 802 | cope with variable-height lines. */ |
| 803 | XSETINT (value, PT); | 803 | start_display (&it, w, startp); |
| 804 | TEMP_SET_PT_BOTH (opoint, opoint_byte); | 804 | move_it_vertically (&it, window_box_height (w)); |
| 805 | value = make_number (IT_CHARPOS (it)); | ||
| 805 | } | 806 | } |
| 806 | else | 807 | else |
| 807 | XSETINT (value, | 808 | XSETINT (value, BUF_Z (XBUFFER (buf)) - XFASTINT (w->window_end_pos)); |
| 808 | BUF_Z (XBUFFER (buf)) - XFASTINT (w->window_end_pos)); | ||
| 809 | 809 | ||
| 810 | return value; | 810 | return value; |
| 811 | } | 811 | } |