4783 |
/* We moved the window start towards ZV, so PT may be now |
/* We moved the window start towards ZV, so PT may be now |
4784 |
in the scroll margin at the top. */ |
in the scroll margin at the top. */ |
4785 |
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
4786 |
if (IT_CHARPOS (it) == PT && it.current_y >= this_scroll_margin) |
if (IT_CHARPOS (it) == PT && it.current_y >= this_scroll_margin |
4787 |
|
&& (NILP (Vscroll_preserve_screen_position) |
4788 |
|
|| EQ (Vscroll_preserve_screen_position, Qt))) |
4789 |
/* We found PT at a legitimate height. Leave it alone. */ |
/* We found PT at a legitimate height. Leave it alone. */ |
4790 |
; |
; |
4791 |
else if (preserve_y >= 0) |
else if (preserve_y >= 0) |
4838 |
partial_p = it.current_y > it.last_visible_y; |
partial_p = it.current_y > it.last_visible_y; |
4839 |
} |
} |
4840 |
|
|
4841 |
if (charpos == PT && !partial_p) |
if (charpos == PT && !partial_p |
4842 |
|
&& (NILP (Vscroll_preserve_screen_position) |
4843 |
|
|| EQ (Vscroll_preserve_screen_position, Qt))) |
4844 |
/* We found PT before we found the display margin, so PT is ok. */ |
/* We found PT before we found the display margin, so PT is ok. */ |
4845 |
; |
; |
4846 |
else if (preserve_y >= 0) |
else if (preserve_y >= 0) |
4955 |
the window-scroll-functions. */ |
the window-scroll-functions. */ |
4956 |
w->force_start = Qt; |
w->force_start = Qt; |
4957 |
|
|
4958 |
if (whole && !NILP (Vscroll_preserve_screen_position)) |
if (!NILP (Vscroll_preserve_screen_position) |
4959 |
|
&& (whole || !EQ (Vscroll_preserve_screen_position, Qt))) |
4960 |
{ |
{ |
4961 |
SET_PT_BOTH (pos, pos_byte); |
SET_PT_BOTH (pos, pos_byte); |
4962 |
Fvertical_motion (make_number (original_vpos), window); |
Fvertical_motion (make_number (original_vpos), window); |
6919 |
|
|
6920 |
DEFVAR_LISP ("scroll-preserve-screen-position", |
DEFVAR_LISP ("scroll-preserve-screen-position", |
6921 |
&Vscroll_preserve_screen_position, |
&Vscroll_preserve_screen_position, |
6922 |
doc: /* *Non-nil means scroll commands move point to keep its screen line unchanged. |
doc: /* *Controls if scroll commands move point to keep its screen line unchanged. |
6923 |
This is only when it is impossible to keep point fixed and still |
A value of nil means point does not keep its screen position except |
6924 |
scroll as specified. */); |
at the scroll margin or window boundary respectively. |
6925 |
|
A value of t means point keeps its screen position if the scroll |
6926 |
|
command moved it vertically out of the window, e.g. when scrolling |
6927 |
|
by full screens. |
6928 |
|
Any other value means point always keeps its screen position. */); |
6929 |
Vscroll_preserve_screen_position = Qnil; |
Vscroll_preserve_screen_position = Qnil; |
6930 |
|
|
6931 |
DEFVAR_LISP ("window-configuration-change-hook", |
DEFVAR_LISP ("window-configuration-change-hook", |