aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-01-16 14:59:37 +0000
committerGerd Moellmann2001-01-16 14:59:37 +0000
commitc67fa41033af2c13f32cd0d18c090d3069651cb1 (patch)
tree79c17004fea3c5006819b9d7e8fc70866d2e7763 /src
parentd57b83b374b66a81ed214f84898dd8f96841f83b (diff)
downloademacs-c67fa41033af2c13f32cd0d18c090d3069651cb1.tar.gz
emacs-c67fa41033af2c13f32cd0d18c090d3069651cb1.zip
(Fset_window_hscroll): Don't set window's min_hscroll
here. (Fscroll_right, Fscroll_left): Set it here instead, if called interactively.
Diffstat (limited to 'src')
-rw-r--r--src/window.c37
1 files changed, 25 insertions, 12 deletions
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.")
430 if (XINT (w->hscroll) != hscroll) 430 if (XINT (w->hscroll) != hscroll)
431 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; 431 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
432 432
433 w->hscroll = w->min_hscroll = make_number (hscroll); 433 w->hscroll = make_number (hscroll);
434 return ncol; 434 return ncol;
435} 435}
436 436
@@ -4407,16 +4407,22 @@ Default for ARG is window width minus 2.")
4407 (arg) 4407 (arg)
4408 register Lisp_Object arg; 4408 register Lisp_Object arg;
4409{ 4409{
4410 4410 Lisp_Object result;
4411 int hscroll;
4412 struct window *w = XWINDOW (selected_window);
4413
4411 if (NILP (arg)) 4414 if (NILP (arg))
4412 XSETFASTINT (arg, window_internal_width (XWINDOW (selected_window)) - 2); 4415 XSETFASTINT (arg, window_internal_width (w) - 2);
4413 else 4416 else
4414 arg = Fprefix_numeric_value (arg); 4417 arg = Fprefix_numeric_value (arg);
4415 4418
4416 return 4419 hscroll = XINT (w->hscroll) + XINT (arg);
4417 Fset_window_hscroll (selected_window, 4420 result = Fset_window_hscroll (selected_window, make_number (hscroll));
4418 make_number (XINT (XWINDOW (selected_window)->hscroll) 4421
4419 + XINT (arg))); 4422 if (!NILP (Finteractive_p ()))
4423 w->min_hscroll = w->hscroll;
4424
4425 return result;
4420} 4426}
4421 4427
4422DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "P", 4428DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "P",
@@ -4425,15 +4431,22 @@ Default for ARG is window width minus 2.")
4425 (arg) 4431 (arg)
4426 register Lisp_Object arg; 4432 register Lisp_Object arg;
4427{ 4433{
4434 Lisp_Object result;
4435 int hscroll;
4436 struct window *w = XWINDOW (selected_window);
4437
4428 if (NILP (arg)) 4438 if (NILP (arg))
4429 XSETFASTINT (arg, window_internal_width (XWINDOW (selected_window)) - 2); 4439 XSETFASTINT (arg, window_internal_width (w) - 2);
4430 else 4440 else
4431 arg = Fprefix_numeric_value (arg); 4441 arg = Fprefix_numeric_value (arg);
4432 4442
4433 return 4443 hscroll = XINT (w->hscroll) - XINT (arg);
4434 Fset_window_hscroll (selected_window, 4444 result = Fset_window_hscroll (selected_window, make_number (hscroll));
4435 make_number (XINT (XWINDOW (selected_window)->hscroll) 4445
4436 - XINT (arg))); 4446 if (!NILP (Finteractive_p ()))
4447 w->min_hscroll = w->hscroll;
4448
4449 return result;
4437} 4450}
4438 4451
4439/* Value is the number of lines actually displayed in window W, 4452/* Value is the number of lines actually displayed in window W,