diff options
| author | Eli Zaretskii | 2011-03-27 00:05:30 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-03-27 00:05:30 +0200 |
| commit | 3b2c5ab1f0714b26e760a4816eb1c24eefdddbd2 (patch) | |
| tree | 2e96634415125d5ecec530cf163781b24a4367c4 /src | |
| parent | 06b6bbb578cae9ebc00ffd6d4a2c7dc4995588bf (diff) | |
| download | emacs-3b2c5ab1f0714b26e760a4816eb1c24eefdddbd2.tar.gz emacs-3b2c5ab1f0714b26e760a4816eb1c24eefdddbd2.zip | |
Fix scrolling with scroll-*-aggressively.
Aggressive scrolling backward by large distance still doesn't DTRT.
src/xdisp.c (try_scrolling): When aggressive scrolling is in use, don't
let point enter the opposite scroll margin as result of the scroll.
(redisplay_window): Fix operator precedence in condition.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ef3a1546913..d4301c482e9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -8,6 +8,9 @@ | |||
| 8 | (redisplay_window): Even when falling back on "recentering", | 8 | (redisplay_window): Even when falling back on "recentering", |
| 9 | position point in the window according to scroll-conservatively, | 9 | position point in the window according to scroll-conservatively, |
| 10 | scroll-margin, and scroll-*-aggressively variables. (Bug#6671) | 10 | scroll-margin, and scroll-*-aggressively variables. (Bug#6671) |
| 11 | (try_scrolling): When aggressive scrolling is in use, don't let | ||
| 12 | point enter the opposite scroll margin as result of the scroll. | ||
| 13 | (redisplay_window): Fix operator precedence in condition. | ||
| 11 | 14 | ||
| 12 | 2011-03-26 Juanma Barranquero <lekktu@gmail.com> | 15 | 2011-03-26 Juanma Barranquero <lekktu@gmail.com> |
| 13 | 16 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 263bedec4a2..230e2fa1864 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13125,6 +13125,10 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13125 | amount_to_scroll = float_amount; | 13125 | amount_to_scroll = float_amount; |
| 13126 | if (amount_to_scroll == 0 && float_amount > 0) | 13126 | if (amount_to_scroll == 0 && float_amount > 0) |
| 13127 | amount_to_scroll = 1; | 13127 | amount_to_scroll = 1; |
| 13128 | /* Don't let point enter the scroll margin near top of | ||
| 13129 | the window. */ | ||
| 13130 | if (amount_to_scroll > height - 2*this_scroll_margin + dy) | ||
| 13131 | amount_to_scroll = height - 2*this_scroll_margin + dy; | ||
| 13128 | } | 13132 | } |
| 13129 | } | 13133 | } |
| 13130 | 13134 | ||
| @@ -13208,6 +13212,11 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13208 | amount_to_scroll = float_amount; | 13212 | amount_to_scroll = float_amount; |
| 13209 | if (amount_to_scroll == 0 && float_amount > 0) | 13213 | if (amount_to_scroll == 0 && float_amount > 0) |
| 13210 | amount_to_scroll = 1; | 13214 | amount_to_scroll = 1; |
| 13215 | amount_to_scroll -= this_scroll_margin - dy; | ||
| 13216 | /* Don't let point enter the scroll margin near | ||
| 13217 | bottom of the window. */ | ||
| 13218 | if (amount_to_scroll > height - 2*this_scroll_margin + dy) | ||
| 13219 | amount_to_scroll = height - 2*this_scroll_margin + dy; | ||
| 13211 | } | 13220 | } |
| 13212 | } | 13221 | } |
| 13213 | 13222 | ||
| @@ -14236,7 +14245,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 14236 | : BVAR (current_buffer, scroll_down_aggressively); | 14245 | : BVAR (current_buffer, scroll_down_aggressively); |
| 14237 | 14246 | ||
| 14238 | if (!MINI_WINDOW_P (w) | 14247 | if (!MINI_WINDOW_P (w) |
| 14239 | && scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive)) | 14248 | && (scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive))) |
| 14240 | { | 14249 | { |
| 14241 | int pt_offset = 0; | 14250 | int pt_offset = 0; |
| 14242 | 14251 | ||