aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-09-05 21:22:46 +0000
committerGerd Moellmann1999-09-05 21:22:46 +0000
commit470049525f4c6af994570ae6a4cf3311f442e929 (patch)
tree91749bb074fa395651be46523493ec8c5420aaad /src
parent2a53558db36cc034502f26cebdb41f9ff53f4a4a (diff)
downloademacs-470049525f4c6af994570ae6a4cf3311f442e929.tar.gz
emacs-470049525f4c6af994570ae6a4cf3311f442e929.zip
(Fset_window_vscroll): Make window the first argument,
amount to scroll the second. Take non-negative vscroll as argument. (Fwindow_vscroll): Return non-negative vscroll.
Diffstat (limited to 'src')
-rw-r--r--src/window.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/window.c b/src/window.c
index 5f1af561632..6f1a325d67c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4643,43 +4643,51 @@ Value is a multiple of the canonical character height of WINDOW.")
4643 (window) 4643 (window)
4644 Lisp_Object window; 4644 Lisp_Object window;
4645{ 4645{
4646 Lisp_Object result;
4646 struct frame *f; 4647 struct frame *f;
4647 struct window *w; 4648 struct window *w;
4648 4649
4649 if (NILP (window)) 4650 if (NILP (window))
4650 window = selected_window; 4651 window = selected_window;
4652 else
4653 CHECK_WINDOW (window, 0);
4651 w = XWINDOW (window); 4654 w = XWINDOW (window);
4652 f = XFRAME (w->frame); 4655 f = XFRAME (w->frame);
4653 4656
4654 if (FRAME_WINDOW_P (f)) 4657 if (FRAME_WINDOW_P (f))
4655 return CANON_Y_FROM_PIXEL_Y (f, w->vscroll); 4658 result = CANON_Y_FROM_PIXEL_Y (f, -w->vscroll);
4656 else 4659 else
4657 return make_number (0); 4660 result = make_number (0);
4661 return result;
4658} 4662}
4659 4663
4660 4664
4661DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, 4665DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll,
4662 1, 2, 0, 4666 2, 2, 0,
4663 "Set amount by WINDOW should be scrolled vertically to VSCROLL.\n\ 4667 "Set amount by which WINDOW should be scrolled vertically to VSCROLL.\n\
4664WINDOW nil or omitted means use the selected window. VSCROLL is a\n\ 4668WINDOW nil or omitted means use the selected window. VSCROLL is a\n\
4665multiple of the canonical character height of WINDOW.") 4669non-negative multiple of the canonical character height of WINDOW.")
4666 (vscroll, window) 4670 (window, vscroll)
4667 Lisp_Object vscroll, window; 4671 Lisp_Object window, vscroll;
4668{ 4672{
4669 struct window *w; 4673 struct window *w;
4670 struct frame *f; 4674 struct frame *f;
4671 4675
4672 CHECK_NUMBER_OR_FLOAT (vscroll, 0);
4673
4674 if (NILP (window)) 4676 if (NILP (window))
4675 window = selected_window; 4677 window = selected_window;
4678 else
4679 CHECK_WINDOW (window, 0);
4680 CHECK_NUMBER_OR_FLOAT (vscroll, 1);
4681
4676 w = XWINDOW (window); 4682 w = XWINDOW (window);
4677 f = XFRAME (w->frame); 4683 f = XFRAME (w->frame);
4678 4684
4679 if (FRAME_WINDOW_P (f)) 4685 if (FRAME_WINDOW_P (f))
4680 { 4686 {
4681 int old_dy = w->vscroll; 4687 int old_dy = w->vscroll;
4682 w->vscroll = min (0, CANON_Y_UNIT (f) * XFLOATINT (vscroll)); 4688
4689 w->vscroll = - CANON_Y_UNIT (f) * XFLOATINT (vscroll);
4690 w->vscroll = min (w->vscroll, 0);
4683 4691
4684 /* Adjust glyph matrix of the frame if the virtual display 4692 /* Adjust glyph matrix of the frame if the virtual display
4685 area becomes larger than before. */ 4693 area becomes larger than before. */
@@ -4690,7 +4698,7 @@ multiple of the canonical character height of WINDOW.")
4690 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; 4698 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
4691 } 4699 }
4692 4700
4693 return Qnil; 4701 return Fwindow_vscroll (window);
4694} 4702}
4695 4703
4696 4704