diff options
| author | Gerd Moellmann | 2001-02-20 16:00:18 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-02-20 16:00:18 +0000 |
| commit | 99593a9de0595c12132c7a1546d8f1d357b472bf (patch) | |
| tree | 10a2f8837ad97f6e6c66c0c359b7c92cb14a5561 /src | |
| parent | ee1dbcebdc2b0167452d5a27ac07dddfea71d2d0 (diff) | |
| download | emacs-99593a9de0595c12132c7a1546d8f1d357b472bf.tar.gz emacs-99593a9de0595c12132c7a1546d8f1d357b472bf.zip | |
(Fwindow_end): Handle case that WINDOW's buffer is not
equal to the current buffer.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index 61c4d3c83b8..051ab8f400a 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -912,6 +912,7 @@ if it isn't already recorded.") | |||
| 912 | { | 912 | { |
| 913 | struct text_pos startp; | 913 | struct text_pos startp; |
| 914 | struct it it; | 914 | struct it it; |
| 915 | struct buffer *old_buffer = NULL, *b = XBUFFER (buf); | ||
| 915 | 916 | ||
| 916 | /* In case W->start is out of the range, use something | 917 | /* In case W->start is out of the range, use something |
| 917 | reasonable. This situation occured when loading a file with | 918 | reasonable. This situation occured when loading a file with |
| @@ -927,10 +928,19 @@ if it isn't already recorded.") | |||
| 927 | 928 | ||
| 928 | /* Cannot use Fvertical_motion because that function doesn't | 929 | /* Cannot use Fvertical_motion because that function doesn't |
| 929 | cope with variable-height lines. */ | 930 | cope with variable-height lines. */ |
| 931 | if (b != current_buffer) | ||
| 932 | { | ||
| 933 | old_buffer = current_buffer; | ||
| 934 | set_buffer_internal (b); | ||
| 935 | } | ||
| 936 | |||
| 930 | start_display (&it, w, startp); | 937 | start_display (&it, w, startp); |
| 931 | move_it_vertically (&it, window_box_height (w)); | 938 | move_it_vertically (&it, window_box_height (w)); |
| 932 | move_it_past_eol (&it); | 939 | move_it_past_eol (&it); |
| 933 | value = make_number (IT_CHARPOS (it)); | 940 | value = make_number (IT_CHARPOS (it)); |
| 941 | |||
| 942 | if (old_buffer) | ||
| 943 | set_buffer_internal (old_buffer); | ||
| 934 | } | 944 | } |
| 935 | else | 945 | else |
| 936 | XSETINT (value, BUF_Z (XBUFFER (buf)) - XFASTINT (w->window_end_pos)); | 946 | XSETINT (value, BUF_Z (XBUFFER (buf)) - XFASTINT (w->window_end_pos)); |