comparison src/indent.c @ 6327:d93a087868cb

(Fvertical_motion): New optional arg WINDOW.
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Mar 1994 01:29:15 +0000
parents a1b438e4754b
children 5ef02598a0ad
comparison
equal deleted inserted replaced
6326:5e662ad3f594 6327:d93a087868cb
803 803
804 /* Otherwise find the correct spot by moving down */ 804 /* Otherwise find the correct spot by moving down */
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);
830 } 836 }
831 837