changeset 35341:f3eb82d93802

(Fset_window_hscroll): Don't set window's min_hscroll here. (Fscroll_right, Fscroll_left): Set it here instead, if called interactively.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 16 Jan 2001 14:59:37 +0000
parents c1a48fd56d2d
children 97862465be03
files src/window.c
diffstat 1 files changed, 25 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Tue Jan 16 14:21:59 2001 +0000
+++ b/src/window.c	Tue Jan 16 14:59:37 2001 +0000
@@ -430,7 +430,7 @@
   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 @@
   (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 @@
   (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,