(gnus-article-next-page-1): Don't scroll if there're fewer lines than that of
authorKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 26 Jul 2005 02:30:04 +0000 (02:30 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Tue, 26 Jul 2005 02:30:04 +0000 (02:30 +0000)
 scroll-margin.
(gnus-article-prev-page): Narrow the range to bind scroll-in-place.

lisp/ChangeLog
lisp/gnus-art.el

index 74d4a1c..9633cee 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-26  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-next-page-1): Don't scroll if there're
+       fewer lines than that of scroll-margin.
+       (gnus-article-prev-page): Narrow the range to bind scroll-in-place.
+
 2005-07-25  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-next-page): Revert.
index 75de415..63e2fc1 100644 (file)
@@ -5199,13 +5199,17 @@ specifies."
                     (if header-line-format 1 0)))))))
 
 (defun gnus-article-next-page-1 (lines)
-  (let ((scroll-in-place nil))
+  (unless (and (not (featurep 'xemacs))
+              (> (symbol-value 'scroll-margin) 0)
+              (<= (count-lines (window-start) (point-max))
+                  (symbol-value 'scroll-margin)))
     (condition-case ()
-       (scroll-up lines)
+       (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))
+       (goto-char (point-max))))
+    (gnus-article-beginning-of-window)))
 
 (defun gnus-article-prev-page (&optional lines)
   "Show previous page of current article.
@@ -5219,13 +5223,13 @@ Argument LINES specifies lines to be scrolled down."
        (gnus-narrow-to-page -1)        ;Go to previous page.
        (goto-char (point-max))
        (recenter -1))
-    (let ((scroll-in-place nil))
-      (prog1
-         (condition-case ()
-             (scroll-down lines)
-           (beginning-of-buffer
-            (goto-char (point-min))))
-       (gnus-article-beginning-of-window)))))
+    (prog1
+       (condition-case ()
+           (let ((scroll-in-place nil))
+             (scroll-down lines))
+         (beginning-of-buffer
+          (goto-char (point-min))))
+      (gnus-article-beginning-of-window))))
 
 (defun gnus-article-only-boring-p ()
   "Decide whether there is only boring text remaining in the article.