diff options
| author | Luc Teirlinck | 2006-03-11 16:46:38 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2006-03-11 16:46:38 +0000 |
| commit | 66fe93d1c2e84e08577b6bd8666abff0cfcb50dd (patch) | |
| tree | 2cd07694233b52dd7d855dfbc5db5c8f22fbe3e7 /src/window.c | |
| parent | 2c1bd367aad6bd4229f769ef4a50b2e2888bf958 (diff) | |
| download | emacs-66fe93d1c2e84e08577b6bd8666abff0cfcb50dd.tar.gz emacs-66fe93d1c2e84e08577b6bd8666abff0cfcb50dd.zip | |
Rename preserve_y to window_scroll_pixel_based_preserve_y.
(window_scroll_pixel_based, syms_of_window): Adapt to above change.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/window.c b/src/window.c index cc453941304..c8067f9035d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -217,7 +217,7 @@ int window_deletion_count; | |||
| 217 | 217 | ||
| 218 | /* Used by the function window_scroll_pixel_based */ | 218 | /* Used by the function window_scroll_pixel_based */ |
| 219 | 219 | ||
| 220 | static int preserve_y; | 220 | static int window_scroll_pixel_based_preserve_y; |
| 221 | 221 | ||
| 222 | #if 0 /* This isn't used anywhere. */ | 222 | #if 0 /* This isn't used anywhere. */ |
| 223 | /* Nonzero means we can split a frame even if it is "unsplittable". */ | 223 | /* Nonzero means we can split a frame even if it is "unsplittable". */ |
| @@ -4795,17 +4795,17 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4795 | calls to scroll-up or scroll-down. This avoids the | 4795 | calls to scroll-up or scroll-down. This avoids the |
| 4796 | possibility of point becoming "stuck" on a tall line when | 4796 | possibility of point becoming "stuck" on a tall line when |
| 4797 | scrolling by one line. */ | 4797 | scrolling by one line. */ |
| 4798 | if (preserve_y < 0 | 4798 | if (window_scroll_pixel_based_preserve_y < 0 |
| 4799 | || (current_kboard->Vlast_command != Qscroll_up | 4799 | || (current_kboard->Vlast_command != Qscroll_up |
| 4800 | && current_kboard->Vlast_command != Qscroll_down)) | 4800 | && current_kboard->Vlast_command != Qscroll_down)) |
| 4801 | { | 4801 | { |
| 4802 | start_display (&it, w, start); | 4802 | start_display (&it, w, start); |
| 4803 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | 4803 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
| 4804 | preserve_y = it.current_y; | 4804 | window_scroll_pixel_based_preserve_y = it.current_y; |
| 4805 | } | 4805 | } |
| 4806 | } | 4806 | } |
| 4807 | else | 4807 | else |
| 4808 | preserve_y = -1; | 4808 | window_scroll_pixel_based_preserve_y = -1; |
| 4809 | 4809 | ||
| 4810 | /* Move iterator it from start the specified distance forward or | 4810 | /* Move iterator it from start the specified distance forward or |
| 4811 | backward. The result is the new window start. */ | 4811 | backward. The result is the new window start. */ |
| @@ -4935,12 +4935,13 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4935 | || EQ (Vscroll_preserve_screen_position, Qt))) | 4935 | || EQ (Vscroll_preserve_screen_position, Qt))) |
| 4936 | /* We found PT at a legitimate height. Leave it alone. */ | 4936 | /* We found PT at a legitimate height. Leave it alone. */ |
| 4937 | ; | 4937 | ; |
| 4938 | else if (preserve_y >= 0) | 4938 | else if (window_scroll_pixel_based_preserve_y >= 0) |
| 4939 | { | 4939 | { |
| 4940 | /* If we have a header line, take account of it. | 4940 | /* If we have a header line, take account of it. |
| 4941 | This is necessary because we set it.current_y to 0, above. */ | 4941 | This is necessary because we set it.current_y to 0, above. */ |
| 4942 | move_it_to (&it, -1, -1, | 4942 | move_it_to (&it, -1, -1, |
| 4943 | preserve_y - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ), | 4943 | window_scroll_pixel_based_preserve_y |
| 4944 | - (WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0 ), | ||
| 4944 | -1, MOVE_TO_Y); | 4945 | -1, MOVE_TO_Y); |
| 4945 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | 4946 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
| 4946 | } | 4947 | } |
| @@ -4961,7 +4962,8 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4961 | int charpos, bytepos; | 4962 | int charpos, bytepos; |
| 4962 | int partial_p; | 4963 | int partial_p; |
| 4963 | 4964 | ||
| 4964 | /* Save our position, for the preserve_y case. */ | 4965 | /* Save our position, for the |
| 4966 | window_scroll_pixel_based_preserve_y case. */ | ||
| 4965 | charpos = IT_CHARPOS (it); | 4967 | charpos = IT_CHARPOS (it); |
| 4966 | bytepos = IT_BYTEPOS (it); | 4968 | bytepos = IT_BYTEPOS (it); |
| 4967 | 4969 | ||
| @@ -4991,14 +4993,15 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4991 | || EQ (Vscroll_preserve_screen_position, Qt))) | 4993 | || EQ (Vscroll_preserve_screen_position, Qt))) |
| 4992 | /* We found PT before we found the display margin, so PT is ok. */ | 4994 | /* We found PT before we found the display margin, so PT is ok. */ |
| 4993 | ; | 4995 | ; |
| 4994 | else if (preserve_y >= 0) | 4996 | else if (window_scroll_pixel_based_preserve_y >= 0) |
| 4995 | { | 4997 | { |
| 4996 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4998 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4997 | start_display (&it, w, start); | 4999 | start_display (&it, w, start); |
| 4998 | /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT | 5000 | /* It would be wrong to subtract CURRENT_HEADER_LINE_HEIGHT |
| 4999 | here because we called start_display again and did not | 5001 | here because we called start_display again and did not |
| 5000 | alter it.current_y this time. */ | 5002 | alter it.current_y this time. */ |
| 5001 | move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); | 5003 | move_it_to (&it, -1, -1, window_scroll_pixel_based_preserve_y, -1, |
| 5004 | MOVE_TO_Y); | ||
| 5002 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | 5005 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
| 5003 | } | 5006 | } |
| 5004 | else | 5007 | else |
| @@ -7025,7 +7028,7 @@ syms_of_window () | |||
| 7025 | minibuf_selected_window = Qnil; | 7028 | minibuf_selected_window = Qnil; |
| 7026 | staticpro (&minibuf_selected_window); | 7029 | staticpro (&minibuf_selected_window); |
| 7027 | 7030 | ||
| 7028 | preserve_y = -1; | 7031 | window_scroll_pixel_based_preserve_y = -1; |
| 7029 | 7032 | ||
| 7030 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, | 7033 | DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, |
| 7031 | doc: /* Non-nil means call as function to display a help buffer. | 7034 | doc: /* Non-nil means call as function to display a help buffer. |