summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-03-14 01:29:15 +0000
committerRichard M. Stallman <rms@gnu.org>1994-03-14 01:29:15 +0000
commitf1ecfe9bc4c2aabf12cb15d11dc97d181b3779b2 (patch)
tree6d095adc2b48d227f594e10c1b05cdaad8814f62 /src
parent540b6aa005092c3f4dace9c70edb664fa8485592 (diff)
downloademacs-f1ecfe9bc4c2aabf12cb15d11dc97d181b3779b2.tar.gz
(Fvertical_motion): New optional arg WINDOW.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/indent.c b/src/indent.c
index e4ab5ff735e..5eef49c3a16 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -805,25 +805,31 @@ vmotion (from, vtarget, width, hscroll, window)
goto retry;
}
-DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 1, 0,
+DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 2, 0,
"Move to start of screen line LINES lines down.\n\
If LINES is negative, this is moving up.\n\
+The optional second argument WINDOW specifies the window\n\
+ to use for computations.\n\
Sets point to position found; this may be start of line\n\
or just the start of a continuation line.\n\
Returns number of lines moved; may be closer to zero than LINES\n\
if beginning or end of buffer was reached.")
- (lines)
- Lisp_Object lines;
+ (lines, window)
+ Lisp_Object lines, window;
{
struct position pos;
register struct window *w = XWINDOW (selected_window);
int width = window_internal_width (w) - 1;
CHECK_NUMBER (lines, 0);
+ if (! NILP (window))
+ CHECK_WINDOW (window, 0);
+ else
+ XSET (window, Lisp_Window, selected_window);
pos = *vmotion (point, XINT (lines), width,
/* Not XFASTINT since perhaps could be negative */
- XINT (w->hscroll), selected_window);
+ XINT (w->hscroll), window);
SET_PT (pos.bufpos);
return make_number (pos.vpos);