aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorKaroly Lorentey2006-03-04 23:07:13 +0000
committerKaroly Lorentey2006-03-04 23:07:13 +0000
commit00bc10dab1f80e3fcf1b8e67dd7618c32ae3926d (patch)
tree875ed4fe8e87a4a52d5ea46140b3c70487847c81 /src/window.c
parentbdf36482bbea390390ae7ab1461b14b807c4fb1f (diff)
parent5e9edb94b78ef77981213fca9319d591c7362855 (diff)
downloademacs-00bc10dab1f80e3fcf1b8e67dd7618c32ae3926d.tar.gz
emacs-00bc10dab1f80e3fcf1b8e67dd7618c32ae3926d.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-128 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-129 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-130 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-131 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-132 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-133 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-134 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-135 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-43 Munge arch explicit ids in etc/images to match Emacs * emacs@sv.gnu.org/gnus--rel--5.10--patch-44 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-45 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-46 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-47 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-48 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-524
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/src/window.c b/src/window.c
index 29701a1ac62..36050ac649e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -52,6 +52,7 @@ Boston, MA 02110-1301, USA. */
52 52
53 53
54Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; 54Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
55Lisp_Object Qscroll_up, Qscroll_down;
55Lisp_Object Qwindow_size_fixed; 56Lisp_Object Qwindow_size_fixed;
56extern Lisp_Object Qleft_margin, Qright_margin; 57extern Lisp_Object Qleft_margin, Qright_margin;
57 58
@@ -4723,9 +4724,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4723 struct text_pos start; 4724 struct text_pos start;
4724 Lisp_Object tem; 4725 Lisp_Object tem;
4725 int this_scroll_margin; 4726 int this_scroll_margin;
4726 int preserve_y;
4727 /* True if we fiddled the window vscroll field without really scrolling. */ 4727 /* True if we fiddled the window vscroll field without really scrolling. */
4728 int vscrolled = 0; 4728 int vscrolled = 0;
4729 static int preserve_y = -1;
4729 4730
4730 SET_TEXT_POS_FROM_MARKER (start, w->start); 4731 SET_TEXT_POS_FROM_MARKER (start, w->start);
4731 4732
@@ -4789,9 +4790,18 @@ window_scroll_pixel_based (window, n, whole, noerror)
4789 point in the same window line as it is now, so get that line. */ 4790 point in the same window line as it is now, so get that line. */
4790 if (!NILP (Vscroll_preserve_screen_position)) 4791 if (!NILP (Vscroll_preserve_screen_position))
4791 { 4792 {
4792 start_display (&it, w, start); 4793 /* We preserve the goal pixel coordinate across consecutive
4793 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4794 calls to scroll-up or scroll-down. This avoids the
4794 preserve_y = it.current_y; 4795 possibility of point becoming "stuck" on a tall line when
4796 scrolling by one line. */
4797 if (preserve_y < 0
4798 || (current_kboard->Vlast_command != Qscroll_up
4799 && current_kboard->Vlast_command != Qscroll_down))
4800 {
4801 start_display (&it, w, start);
4802 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
4803 preserve_y = it.current_y;
4804 }
4795 } 4805 }
4796 else 4806 else
4797 preserve_y = -1; 4807 preserve_y = -1;
@@ -4928,10 +4938,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4928 { 4938 {
4929 /* If we have a header line, take account of it. 4939 /* If we have a header line, take account of it.
4930 This is necessary because we set it.current_y to 0, above. */ 4940 This is necessary because we set it.current_y to 0, above. */
4931 if (WINDOW_WANTS_HEADER_LINE_P (w)) 4941 move_it_to (&it, -1, -1,
4932 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); 4942 preserve_y - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ),
4933 4943 -1, MOVE_TO_Y);
4934 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
4935 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 4944 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
4936 } 4945 }
4937 else 4946 else
@@ -4985,15 +4994,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4985 { 4994 {
4986 SET_TEXT_POS_FROM_MARKER (start, w->start); 4995 SET_TEXT_POS_FROM_MARKER (start, w->start);
4987 start_display (&it, w, start); 4996 start_display (&it, w, start);
4988#if 0 /* It's wrong to subtract this here 4997 /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT
4989 because we called start_display again 4998 here because we called start_display again and did not
4990 and did not alter it.current_y this time. */ 4999 alter it.current_y this time. */
4991
4992 /* If we have a header line, take account of it. */
4993 if (WINDOW_WANTS_HEADER_LINE_P (w))
4994 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w);
4995#endif
4996
4997 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); 5000 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
4998 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 5001 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
4999 } 5002 }
@@ -6990,6 +6993,12 @@ init_window ()
6990void 6993void
6991syms_of_window () 6994syms_of_window ()
6992{ 6995{
6996 Qscroll_up = intern ("scroll-up");
6997 staticpro (&Qscroll_up);
6998
6999 Qscroll_down = intern ("scroll-down");
7000 staticpro (&Qscroll_down);
7001
6993 Qwindow_size_fixed = intern ("window-size-fixed"); 7002 Qwindow_size_fixed = intern ("window-size-fixed");
6994 staticpro (&Qwindow_size_fixed); 7003 staticpro (&Qwindow_size_fixed);
6995 Fset (Qwindow_size_fixed, Qnil); 7004 Fset (Qwindow_size_fixed, Qnil);