(Fvertical_motion): Always use the current buffer.
Temporarily change the window's buffer, if necessary.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2000-03-24 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* indent.c (Fvertical_motion): Always use the current buffer.
|
||||
Temporarily change the window's buffer, if necessary.
|
||||
|
||||
2000-03-23 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* xterm.c (fast_find_position): Make sure not to consider rows
|
||||
|
||||
23
src/indent.c
23
src/indent.c
@@ -1823,34 +1823,35 @@ whether or not it is currently displayed in some window.")
|
||||
{
|
||||
struct it it;
|
||||
struct text_pos pt;
|
||||
struct buffer *old, *b;
|
||||
struct window *w;
|
||||
Lisp_Object old_buffer;
|
||||
struct gcpro gcpro1;
|
||||
|
||||
CHECK_NUMBER (lines, 0);
|
||||
if (! NILP (window))
|
||||
CHECK_WINDOW (window, 0);
|
||||
else
|
||||
window = selected_window;
|
||||
|
||||
w = XWINDOW (window);
|
||||
b = XBUFFER (w->buffer);
|
||||
if (b != current_buffer)
|
||||
|
||||
old_buffer = Qnil;
|
||||
GCPRO1 (old_buffer);
|
||||
if (XBUFFER (w->buffer) != current_buffer)
|
||||
{
|
||||
old = current_buffer;
|
||||
set_buffer_internal_1 (b);
|
||||
/* Set the window's buffer temporarily to the current buffer. */
|
||||
old_buffer = w->buffer;
|
||||
XSETBUFFER (w->buffer, current_buffer);
|
||||
}
|
||||
else
|
||||
old = NULL;
|
||||
|
||||
SET_TEXT_POS (pt, PT, PT_BYTE);
|
||||
start_display (&it, w, pt);
|
||||
move_it_by_lines (&it, XINT (lines), 0);
|
||||
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
|
||||
|
||||
if (old)
|
||||
set_buffer_internal_1 (old);
|
||||
if (BUFFERP (old_buffer))
|
||||
w->buffer = old_buffer;
|
||||
|
||||
return make_number (it.vpos);
|
||||
RETURN_UNGCPRO (make_number (it.vpos));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user