diff options
| author | Richard M. Stallman | 1994-03-14 01:29:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-03-14 01:29:15 +0000 |
| commit | f1ecfe9bc4c2aabf12cb15d11dc97d181b3779b2 (patch) | |
| tree | 6d095adc2b48d227f594e10c1b05cdaad8814f62 /src/indent.c | |
| parent | 540b6aa005092c3f4dace9c70edb664fa8485592 (diff) | |
| download | emacs-f1ecfe9bc4c2aabf12cb15d11dc97d181b3779b2.tar.gz emacs-f1ecfe9bc4c2aabf12cb15d11dc97d181b3779b2.zip | |
(Fvertical_motion): New optional arg WINDOW.
Diffstat (limited to 'src/indent.c')
| -rw-r--r-- | src/indent.c | 14 |
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) | |||
| 805 | goto retry; | 805 | goto retry; |
| 806 | } | 806 | } |
| 807 | 807 | ||
| 808 | DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 1, 0, | 808 | DEFUN ("vertical-motion", Fvertical_motion, Svertical_motion, 1, 2, 0, |
| 809 | "Move to start of screen line LINES lines down.\n\ | 809 | "Move to start of screen line LINES lines down.\n\ |
| 810 | If LINES is negative, this is moving up.\n\ | 810 | If LINES is negative, this is moving up.\n\ |
| 811 | The optional second argument WINDOW specifies the window\n\ | ||
| 812 | to use for computations.\n\ | ||
| 811 | Sets point to position found; this may be start of line\n\ | 813 | Sets point to position found; this may be start of line\n\ |
| 812 | or just the start of a continuation line.\n\ | 814 | or just the start of a continuation line.\n\ |
| 813 | Returns number of lines moved; may be closer to zero than LINES\n\ | 815 | Returns number of lines moved; may be closer to zero than LINES\n\ |
| 814 | if beginning or end of buffer was reached.") | 816 | if beginning or end of buffer was reached.") |
| 815 | (lines) | 817 | (lines, window) |
| 816 | Lisp_Object lines; | 818 | Lisp_Object lines, window; |
| 817 | { | 819 | { |
| 818 | struct position pos; | 820 | struct position pos; |
| 819 | register struct window *w = XWINDOW (selected_window); | 821 | register struct window *w = XWINDOW (selected_window); |
| 820 | int width = window_internal_width (w) - 1; | 822 | int width = window_internal_width (w) - 1; |
| 821 | 823 | ||
| 822 | CHECK_NUMBER (lines, 0); | 824 | CHECK_NUMBER (lines, 0); |
| 825 | if (! NILP (window)) | ||
| 826 | CHECK_WINDOW (window, 0); | ||
| 827 | else | ||
| 828 | XSET (window, Lisp_Window, selected_window); | ||
| 823 | 829 | ||
| 824 | pos = *vmotion (point, XINT (lines), width, | 830 | pos = *vmotion (point, XINT (lines), width, |
| 825 | /* Not XFASTINT since perhaps could be negative */ | 831 | /* Not XFASTINT since perhaps could be negative */ |
| 826 | XINT (w->hscroll), selected_window); | 832 | XINT (w->hscroll), window); |
| 827 | 833 | ||
| 828 | SET_PT (pos.bufpos); | 834 | SET_PT (pos.bufpos); |
| 829 | return make_number (pos.vpos); | 835 | return make_number (pos.vpos); |