diff options
author | Karoly Lorentey <[email protected]> | 2004-11-06 17:52:02 +0000 |
---|---|---|
committer | Karoly Lorentey <[email protected]> | 2004-11-06 17:52:02 +0000 |
commit | 65ea79492334e2ef7b5b4e0d23b6f68ba2f4d0bb (patch) | |
tree | 853cf391ca1abda4f4ccd6fe8e7bb43f7c86ee08 /src/window.c | |
parent | e0bc17abe6979d607e8de4684dddb96e53c60065 (diff) | |
parent | 392cf16dd0ee9358f8af0cd0d8048b822456bbeb (diff) |
Merged in changes from CVS trunk.
Patches applied:
* [email protected]/emacs--cvs-trunk--0--patch-653
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-654
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-655
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-656
Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo.
* [email protected]/emacs--cvs-trunk--0--patch-657
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-658
Merge from gnus--rel--5.10
* [email protected]/emacs--cvs-trunk--0--patch-659
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-660
Merge from gnus--rel--5.10
* [email protected]/emacs--cvs-trunk--0--patch-661
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-662
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-663
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-664
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-665
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-666
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-667
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-668
Merge from gnus--rel--5.10
* [email protected]/emacs--cvs-trunk--0--patch-669
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-670
Update from CVS
* [email protected]/emacs--cvs-trunk--0--patch-671
Update from CVS
* [email protected]/gnus--rel--5.10--patch-64
Update from CVS
* [email protected]/gnus--rel--5.10--patch-65
Update from CVS
* [email protected]/gnus--rel--5.10--patch-66
Update from CVS
* [email protected]/gnus--rel--5.10--patch-67
Update from CVS
* [email protected]/gnus--rel--5.10--patch-68
Update from CVS
git-archimport-id: [email protected]/emacs--multi-tty--0--patch-264
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/src/window.c b/src/window.c index 6b244ca535..d9ac2eb62b 100644 --- a/src/window.c +++ b/src/window.c @@ -4627,17 +4627,25 @@ window_scroll_pixel_based (window, n, whole, noerror) w->force_start = Qt; } + /* The rest of this function uses current_y in a nonstandard way, + not including the height of the header line if any. */ it.current_y = it.vpos = 0; - /* Preserve the screen position if we must. */ + /* Preserve the screen position if we should. */ if (preserve_y >= 0) { + /* If we have a header line, take account of it. */ + if (WINDOW_WANTS_HEADER_LINE_P (w)) + preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); + move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); } else { - /* Move PT out of scroll margins. */ + /* Move PT out of scroll margins. + This code wants current_y to be zero at the window start position + even if there is a header line. */ this_scroll_margin = max (0, scroll_margin); this_scroll_margin = min (this_scroll_margin, XFASTINT (w->total_lines) / 4); this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); @@ -4992,17 +5000,17 @@ specifies the window to scroll. This takes precedence over return Qnil; } -DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 1, "P", +DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 2, "P\np", doc: /* Scroll selected window display ARG columns left. Default for ARG is window width minus 2. Value is the total amount of leftward horizontal scrolling in effect after the change. -If `automatic-hscrolling' is non-nil, the argument ARG modifies -a lower bound for automatic scrolling, i.e. automatic scrolling +If SET_MINIMUM is non-nil, the new scroll amount becomes the +lower bound for automatic scrolling, i.e. automatic scrolling will not scroll a window to a column less than the value returned -by this function. */) - (arg) - register Lisp_Object arg; +by this function. This happens in an interactive call. */) + (arg, set_minimum) + register Lisp_Object arg, set_minimum; { Lisp_Object result; int hscroll; @@ -5016,23 +5024,23 @@ by this function. */) hscroll = XINT (w->hscroll) + XINT (arg); result = Fset_window_hscroll (selected_window, make_number (hscroll)); - if (interactive_p (0)) + if (!NILP (set_minimum)) w->min_hscroll = w->hscroll; return result; } -DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "P", +DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 2, "P\np", doc: /* Scroll selected window display ARG columns right. Default for ARG is window width minus 2. Value is the total amount of leftward horizontal scrolling in effect after the change. -If `automatic-hscrolling' is non-nil, the argument ARG modifies -a lower bound for automatic scrolling, i.e. automatic scrolling +If SET_MINIMUM is non-nil, the new scroll amount becomes the +lower bound for automatic scrolling, i.e. automatic scrolling will not scroll a window to a column less than the value returned -by this function. */) - (arg) - register Lisp_Object arg; +by this function. This happens in an interactive call. */) + (arg, set_minimum) + register Lisp_Object arg, set_minimum; { Lisp_Object result; int hscroll; @@ -5046,7 +5054,7 @@ by this function. */) hscroll = XINT (w->hscroll) - XINT (arg); result = Fset_window_hscroll (selected_window, make_number (hscroll)); - if (interactive_p (0)) + if (!NILP (set_minimum)) w->min_hscroll = w->hscroll; return result; |