]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix scrolling with scroll-*-aggressively.
authorEli Zaretskii <eliz@gnu.org>
Sat, 26 Mar 2011 22:05:30 +0000 (00:05 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 26 Mar 2011 22:05:30 +0000 (00:05 +0200)
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.

src/ChangeLog
src/xdisp.c

index ef3a1546913dc960197b50775f34c7bacfc15634..d4301c482e998200c507c5a49ba4a2e122ed042e 100644 (file)
@@ -8,6 +8,9 @@
        (redisplay_window): Even when falling back on "recentering",
        position point in the window according to scroll-conservatively,
        scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
+       (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.
 
 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
 
index 263bedec4a2d2d71cc090fa0cf4ce31ab0b4c077..230e2fa18640f22c892c5cf0f3789cbfb380dc94 100644 (file)
@@ -13125,6 +13125,10 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
              amount_to_scroll = float_amount;
              if (amount_to_scroll == 0 && float_amount > 0)
                amount_to_scroll = 1;
+             /* Don't let point enter the scroll margin near top of
+                the window.  */
+             if (amount_to_scroll > height - 2*this_scroll_margin + dy)
+               amount_to_scroll = height - 2*this_scroll_margin + dy;
            }
        }
 
@@ -13208,6 +13212,11 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
                  amount_to_scroll = float_amount;
                  if (amount_to_scroll == 0 && float_amount > 0)
                    amount_to_scroll = 1;
+                 amount_to_scroll -= this_scroll_margin - dy;
+                 /* Don't let point enter the scroll margin near
+                    bottom of the window.  */
+                 if (amount_to_scroll > height - 2*this_scroll_margin + dy)
+                   amount_to_scroll = height - 2*this_scroll_margin + dy;
                }
            }
 
@@ -14236,7 +14245,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
        : BVAR (current_buffer, scroll_down_aggressively);
 
       if (!MINI_WINDOW_P (w)
-         && scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive))
+         && (scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive)))
        {
          int pt_offset = 0;