diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-02-20 16:00:18 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-02-20 16:00:18 +0000 |
commit | 99593a9de0595c12132c7a1546d8f1d357b472bf (patch) | |
tree | 10a2f8837ad97f6e6c66c0c359b7c92cb14a5561 /src | |
parent | ee1dbcebdc2b0167452d5a27ac07dddfea71d2d0 (diff) | |
download | emacs-99593a9de0595c12132c7a1546d8f1d357b472bf.tar.gz |
(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.") { struct text_pos startp; struct it it; + struct buffer *old_buffer = NULL, *b = XBUFFER (buf); /* In case W->start is out of the range, use something reasonable. This situation occured when loading a file with @@ -927,10 +928,19 @@ if it isn't already recorded.") /* Cannot use Fvertical_motion because that function doesn't cope with variable-height lines. */ + if (b != current_buffer) + { + old_buffer = current_buffer; + set_buffer_internal (b); + } + start_display (&it, w, startp); move_it_vertically (&it, window_box_height (w)); move_it_past_eol (&it); value = make_number (IT_CHARPOS (it)); + + if (old_buffer) + set_buffer_internal (old_buffer); } else XSETINT (value, BUF_Z (XBUFFER (buf)) - XFASTINT (w->window_end_pos)); |