aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMiles Bader2006-03-03 07:48:46 +0000
committerMiles Bader2006-03-03 07:48:46 +0000
commitd2ad6275c8b11d33d6bbfa9359420d534aa641bc (patch)
tree5cf31f082f04af6e24b8d6907583ce257ec2d5ea /src/window.c
parentb2ed9e82ab8f37303692290f4e0d03ea61ee13f5 (diff)
parent719120eff4b070687d146d70133f5f73cc8fe5c4 (diff)
downloademacs-d2ad6275c8b11d33d6bbfa9359420d534aa641bc.tar.gz
emacs-d2ad6275c8b11d33d6bbfa9359420d534aa641bc.zip
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-34
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 123-134) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 40-48) - Merge from emacs--devo--0 - Update from CVS - Munge arch explicit ids in etc/images to match Emacs
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 e4c8d0612cb..3e94885a810 100644
--- a/src/window.c
+++ b/src/window.c
@@ -50,6 +50,7 @@ Boston, MA 02110-1301, USA. */
50 50
51 51
52Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; 52Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
53Lisp_Object Qscroll_up, Qscroll_down;
53Lisp_Object Qwindow_size_fixed; 54Lisp_Object Qwindow_size_fixed;
54extern Lisp_Object Qleft_margin, Qright_margin; 55extern Lisp_Object Qleft_margin, Qright_margin;
55 56
@@ -4721,9 +4722,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4721 struct text_pos start; 4722 struct text_pos start;
4722 Lisp_Object tem; 4723 Lisp_Object tem;
4723 int this_scroll_margin; 4724 int this_scroll_margin;
4724 int preserve_y;
4725 /* True if we fiddled the window vscroll field without really scrolling. */ 4725 /* True if we fiddled the window vscroll field without really scrolling. */
4726 int vscrolled = 0; 4726 int vscrolled = 0;
4727 static int preserve_y = -1;
4727 4728
4728 SET_TEXT_POS_FROM_MARKER (start, w->start); 4729 SET_TEXT_POS_FROM_MARKER (start, w->start);
4729 4730
@@ -4787,9 +4788,18 @@ window_scroll_pixel_based (window, n, whole, noerror)
4787 point in the same window line as it is now, so get that line. */ 4788 point in the same window line as it is now, so get that line. */
4788 if (!NILP (Vscroll_preserve_screen_position)) 4789 if (!NILP (Vscroll_preserve_screen_position))
4789 { 4790 {
4790 start_display (&it, w, start); 4791 /* We preserve the goal pixel coordinate across consecutive
4791 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 4792 calls to scroll-up or scroll-down. This avoids the
4792 preserve_y = it.current_y; 4793 possibility of point becoming "stuck" on a tall line when
4794 scrolling by one line. */
4795 if (preserve_y < 0
4796 || (current_kboard->Vlast_command != Qscroll_up
4797 && current_kboard->Vlast_command != Qscroll_down))
4798 {
4799 start_display (&it, w, start);
4800 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
4801 preserve_y = it.current_y;
4802 }
4793 } 4803 }
4794 else 4804 else
4795 preserve_y = -1; 4805 preserve_y = -1;
@@ -4926,10 +4936,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4926 { 4936 {
4927 /* If we have a header line, take account of it. 4937 /* If we have a header line, take account of it.
4928 This is necessary because we set it.current_y to 0, above. */ 4938 This is necessary because we set it.current_y to 0, above. */
4929 if (WINDOW_WANTS_HEADER_LINE_P (w)) 4939 move_it_to (&it, -1, -1,
4930 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); 4940 preserve_y - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ),
4931 4941 -1, MOVE_TO_Y);
4932 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
4933 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 4942 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
4934 } 4943 }
4935 else 4944 else
@@ -4983,15 +4992,9 @@ window_scroll_pixel_based (window, n, whole, noerror)
4983 { 4992 {
4984 SET_TEXT_POS_FROM_MARKER (start, w->start); 4993 SET_TEXT_POS_FROM_MARKER (start, w->start);
4985 start_display (&it, w, start); 4994 start_display (&it, w, start);
4986#if 0 /* It's wrong to subtract this here 4995 /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT
4987 because we called start_display again 4996 here because we called start_display again and did not
4988 and did not alter it.current_y this time. */ 4997 alter it.current_y this time. */
4989
4990 /* If we have a header line, take account of it. */
4991 if (WINDOW_WANTS_HEADER_LINE_P (w))
4992 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w);
4993#endif
4994
4995 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); 4998 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
4996 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 4999 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
4997 } 5000 }
@@ -6988,6 +6991,12 @@ init_window ()
6988void 6991void
6989syms_of_window () 6992syms_of_window ()
6990{ 6993{
6994 Qscroll_up = intern ("scroll-up");
6995 staticpro (&Qscroll_up);
6996
6997 Qscroll_down = intern ("scroll-down");
6998 staticpro (&Qscroll_down);
6999
6991 Qwindow_size_fixed = intern ("window-size-fixed"); 7000 Qwindow_size_fixed = intern ("window-size-fixed");
6992 staticpro (&Qwindow_size_fixed); 7001 staticpro (&Qwindow_size_fixed);
6993 Fset (Qwindow_size_fixed, Qnil); 7002 Fset (Qwindow_size_fixed, Qnil);