From: Gerd Moellmann Date: Tue, 16 Jan 2001 14:59:37 +0000 (+0000) Subject: (Fset_window_hscroll): Don't set window's min_hscroll X-Git-Tag: emacs-pretest-21.0.96~263 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c67fa41033af2c13f32cd0d18c090d3069651cb1;p=emacs.git (Fset_window_hscroll): Don't set window's min_hscroll here. (Fscroll_right, Fscroll_left): Set it here instead, if called interactively. --- diff --git a/src/window.c b/src/window.c index 87b2c59ddb2..baa55a53969 100644 --- a/src/window.c +++ b/src/window.c @@ -430,7 +430,7 @@ NCOL should be zero or positive.") if (XINT (w->hscroll) != hscroll) XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; - w->hscroll = w->min_hscroll = make_number (hscroll); + w->hscroll = make_number (hscroll); return ncol; } @@ -4407,16 +4407,22 @@ Default for ARG is window width minus 2.") (arg) register Lisp_Object arg; { - + Lisp_Object result; + int hscroll; + struct window *w = XWINDOW (selected_window); + if (NILP (arg)) - XSETFASTINT (arg, window_internal_width (XWINDOW (selected_window)) - 2); + XSETFASTINT (arg, window_internal_width (w) - 2); else arg = Fprefix_numeric_value (arg); - return - Fset_window_hscroll (selected_window, - make_number (XINT (XWINDOW (selected_window)->hscroll) - + XINT (arg))); + hscroll = XINT (w->hscroll) + XINT (arg); + result = Fset_window_hscroll (selected_window, make_number (hscroll)); + + if (!NILP (Finteractive_p ())) + w->min_hscroll = w->hscroll; + + return result; } DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "P", @@ -4425,15 +4431,22 @@ Default for ARG is window width minus 2.") (arg) register Lisp_Object arg; { + Lisp_Object result; + int hscroll; + struct window *w = XWINDOW (selected_window); + if (NILP (arg)) - XSETFASTINT (arg, window_internal_width (XWINDOW (selected_window)) - 2); + XSETFASTINT (arg, window_internal_width (w) - 2); else arg = Fprefix_numeric_value (arg); - return - Fset_window_hscroll (selected_window, - make_number (XINT (XWINDOW (selected_window)->hscroll) - - XINT (arg))); + hscroll = XINT (w->hscroll) - XINT (arg); + result = Fset_window_hscroll (selected_window, make_number (hscroll)); + + if (!NILP (Finteractive_p ())) + w->min_hscroll = w->hscroll; + + return result; } /* Value is the number of lines actually displayed in window W,