summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>1999-07-21 21:43:52 +0000
committerGerd Moellmann <gerd@gnu.org>1999-07-21 21:43:52 +0000
commit8720a429d9432c585fe1c9db3b52a6d34da8aa36 (patch)
tree85e61e70a4320ff1ef83dcbe78b0a8f415b13a2b /src/indent.c
parent04e209dc56204c774dc08879e54d50138ce48101 (diff)
downloademacs-8720a429d9432c585fe1c9db3b52a6d34da8aa36.tar.gz
(Fvertical_motion): Rewritten.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c
index 5e5c1a0a68d..c51f5bb3fc4 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -203,7 +203,7 @@ width_run_cache_on_off ()
characters immediately following, then *NEXT_BOUNDARY_P
will equal the return value. */
-static int
+int
skip_invisible (pos, next_boundary_p, to, window)
int pos;
int *next_boundary_p;
@@ -1518,6 +1518,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
return &val_compute_motion;
}
+
#if 0 /* The doc string is too long for some compilers,
but make-docfile can find it in this comment. */
DEFUN ("compute-motion", Ffoo, Sfoo, 7, 7, 0,
@@ -1814,7 +1815,10 @@ whether or not it is currently displayed in some window.")
(lines, window)
Lisp_Object lines, window;
{
- struct position pos;
+ struct it it;
+ struct text_pos pt;
+ struct buffer *old, *b;
+ struct window *w;
CHECK_NUMBER (lines, 0);
if (! NILP (window))
@@ -1822,11 +1826,28 @@ whether or not it is currently displayed in some window.")
else
window = selected_window;
- pos = *vmotion (PT, (int) XINT (lines), XWINDOW (window));
-
- SET_PT (pos.bufpos);
- return make_number (pos.vpos);
+ w = XWINDOW (window);
+ b = XBUFFER (w->buffer);
+ if (b != current_buffer)
+ {
+ old = current_buffer;
+ set_buffer_internal_1 (b);
+ }
+ 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);
+
+ return make_number (it.vpos);
}
+
+
/* file's initialization. */