From: Lars Magne Ingebrigtsen Date: Sun, 29 Aug 2010 15:11:48 +0000 (+0200) Subject: Add kludge to allow spacing past big pictures in the article buffer X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=7780910baf577e2505875b877912ca0d7d8dc04c;p=gnus Add kludge to allow spacing past big pictures in the article buffer --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e81d73463..467fae092 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index e83e6aec8..d6730a8a1 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -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)