aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-24 13:31:20 +0000
committerGerd Moellmann2000-03-24 13:31:20 +0000
commit39210e90adf7be66c7ca6c9fd702bbe11e4887e7 (patch)
treef52490b22bca43fd3db87a871d436612533d6052 /src
parent3b55acc9b020e15a7de9a2ec6ea8ed1125e6e9e7 (diff)
downloademacs-39210e90adf7be66c7ca6c9fd702bbe11e4887e7.tar.gz
emacs-39210e90adf7be66c7ca6c9fd702bbe11e4887e7.zip
(Fvertical_motion): Always use the current buffer.
Temporarily change the window's buffer, if necessary.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/indent.c23
2 files changed, 17 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e85a8bf2e0a..f683aaa0bf8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12000-03-24 Gerd Moellmann <gerd@gnu.org>
2
3 * indent.c (Fvertical_motion): Always use the current buffer.
4 Temporarily change the window's buffer, if necessary.
5
12000-03-23 Gerd Moellmann <gerd@gnu.org> 62000-03-23 Gerd Moellmann <gerd@gnu.org>
2 7
3 * xterm.c (fast_find_position): Make sure not to consider rows 8 * xterm.c (fast_find_position): Make sure not to consider rows
diff --git a/src/indent.c b/src/indent.c
index 913b7633469..5d2dbe5ab36 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1823,34 +1823,35 @@ whether or not it is currently displayed in some window.")
1823{ 1823{
1824 struct it it; 1824 struct it it;
1825 struct text_pos pt; 1825 struct text_pos pt;
1826 struct buffer *old, *b;
1827 struct window *w; 1826 struct window *w;
1827 Lisp_Object old_buffer;
1828 struct gcpro gcpro1;
1828 1829
1829 CHECK_NUMBER (lines, 0); 1830 CHECK_NUMBER (lines, 0);
1830 if (! NILP (window)) 1831 if (! NILP (window))
1831 CHECK_WINDOW (window, 0); 1832 CHECK_WINDOW (window, 0);
1832 else 1833 else
1833 window = selected_window; 1834 window = selected_window;
1834
1835 w = XWINDOW (window); 1835 w = XWINDOW (window);
1836 b = XBUFFER (w->buffer); 1836
1837 if (b != current_buffer) 1837 old_buffer = Qnil;
1838 GCPRO1 (old_buffer);
1839 if (XBUFFER (w->buffer) != current_buffer)
1838 { 1840 {
1839 old = current_buffer; 1841 /* Set the window's buffer temporarily to the current buffer. */
1840 set_buffer_internal_1 (b); 1842 old_buffer = w->buffer;
1843 XSETBUFFER (w->buffer, current_buffer);
1841 } 1844 }
1842 else
1843 old = NULL;
1844 1845
1845 SET_TEXT_POS (pt, PT, PT_BYTE); 1846 SET_TEXT_POS (pt, PT, PT_BYTE);
1846 start_display (&it, w, pt); 1847 start_display (&it, w, pt);
1847 move_it_by_lines (&it, XINT (lines), 0); 1848 move_it_by_lines (&it, XINT (lines), 0);
1848 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 1849 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
1849 1850
1850 if (old) 1851 if (BUFFERP (old_buffer))
1851 set_buffer_internal_1 (old); 1852 w->buffer = old_buffer;
1852 1853
1853 return make_number (it.vpos); 1854 RETURN_UNGCPRO (make_number (it.vpos));
1854} 1855}
1855 1856
1856 1857