Add kludge to allow spacing past big pictures in the article buffer
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 29 Aug 2010 15:11:48 +0000 (17:11 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 29 Aug 2010 15:11:48 +0000 (17:11 +0200)
lisp/ChangeLog
lisp/gnus-art.el

index e81d734..467fae0 100644 (file)
@@ -2,6 +2,8 @@
 
        * gnus-art.el (gnus-article-beginning-of-window): Make into defun for
        easier debugging.
+       (gnus-article-beginning-of-window): Add kludge to allow spacing past
+       big pictures in the article buffer.
 
        * mm-decode.el (mm-text-html-renderer): Default the html renderer to
        gnus-article-html.
index e83e6ae..d6730a8 100644 (file)
@@ -6289,12 +6289,16 @@ In Emacs, the point is placed at the line number which `scroll-margin'
 specifies."
   (if (featurep 'xemacs)
       (move-to-window-line 0)
-    (move-to-window-line
-     (min (max 0 scroll-margin)
-         (max 1 (- (window-height)
-                   (if mode-line-format 1 0)
-                   (if header-line-format 1 0)
-                   2))))))
+    ;; There is an obscure bug in Emacs that makes it impossible to
+    ;; scroll past big pictures in the article buffer.  Try to fix
+    ;; this by adding a sanity check by counting the lines visible.
+    (when (> (count-lines (window-start) (window-end)) 30)
+      (move-to-window-line
+       (min (max 0 scroll-margin)
+           (max 1 (- (window-height)
+                     (if mode-line-format 1 0)
+                     (if header-line-format 1 0)
+                     2)))))))
 
 (defun gnus-article-next-page-1 (lines)
   (unless (featurep 'xemacs)