diff lisp/gnus/gnus-art.el @ 64693:6bf3cc5c6ab3

Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-505 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 99) - Update from CVS 2005-07-29 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-art.el (gnus-article-next-page-1): Reduce the number of lines to scroll rather than to stop it. * lisp/gnus/mml.el (mml-generate-default-type): Add doc string. (mml-generate-mime-1): Use mm-default-file-encoding or make it default to application/octet-stream when determining the content type if it is not specified for the part or the mml contents; add a comment about mml-generate-default-type. 2005-07-29 Reiner Steib <Reiner.Steib@gmx.de> * lisp/gnus/mml.el (mml-generate-mime-1): Use mm-default-file-encoding or make it default to application/octet-stream when determining the content type if it is not specified for the external contents. 2005-07-27 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/mm-decode.el (mm-display-external): Delete temp file, directory and buffer immediately if the external process is exited.
author Miles Bader <miles@gnu.org>
date Sun, 31 Jul 2005 00:12:23 +0000
parents 5ecf32f96408
children bfabe4ff7114
line wrap: on
line diff
--- a/lisp/gnus/gnus-art.el	Sat Jul 30 19:04:19 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Sun Jul 31 00:12:23 2005 +0000
@@ -5197,17 +5197,23 @@
 			 1 0)))))))
 
 (defun gnus-article-next-page-1 (lines)
-  (unless (and (not (featurep 'xemacs))
-	       (> (symbol-value 'scroll-margin) 0)
-	       (<= (count-lines (window-start) (point-max))
-		   (symbol-value 'scroll-margin)))
-    (condition-case ()
-	(let ((scroll-in-place nil))
-	  (scroll-up lines))
-      (end-of-buffer
-       ;; Long lines may cause an end-of-buffer error.
-       (goto-char (point-max))))
-    (gnus-article-beginning-of-window)))
+  (when (and (not (featurep 'xemacs))
+	     (numberp lines)
+	     (> lines 0)
+	     (numberp (symbol-value 'scroll-margin))
+	     (> (symbol-value 'scroll-margin) 0))
+    ;; Protect against the bug that Emacs 21.x hangs up when scrolling up for
+    ;; too many number of lines if `scroll-margin' is set as two or greater.
+    (setq lines (min lines
+		     (max 0 (- (count-lines (window-start) (point-max))
+			       (symbol-value 'scroll-margin))))))
+  (condition-case ()
+      (let ((scroll-in-place nil))
+	(scroll-up lines))
+    (end-of-buffer
+     ;; Long lines may cause an end-of-buffer error.
+     (goto-char (point-max))))
+  (gnus-article-beginning-of-window))
 
 (defun gnus-article-prev-page (&optional lines)
   "Show previous page of current article.