*** empty log message ***
[gnus] / lisp / gnus-sum.el
index 7a45708..6e0cd25 100644 (file)
@@ -2387,10 +2387,16 @@ This is all marks except unread, ticked, dormant, and expirable."
          (set-buffer gnus-article-buffer)
          (setq gnus-summary-buffer summary))))))
 
+(defun gnus-summary-first-article-p (&optional article)
+  "Return whether ARTICLE is the first article in the buffer."
+  (if (not (setq article (or article (gnus-summary-article-number))))
+      nil
+    (eq article (caar gnus-newsgroup-data))))
+
 (defun gnus-summary-last-article-p (&optional article)
   "Return whether ARTICLE is the last article in the buffer."
   (if (not (setq article (or article (gnus-summary-article-number))))
-      t                                        ; All non-existent numbers are the last article.  :-)
+      t                ; All non-existent numbers are the last article.  :-)
     (not (cdr (gnus-data-find-list article)))))
 
 (defun gnus-make-thread-indent-array ()
@@ -5370,8 +5376,11 @@ If BACKWARD, the previous article is selected instead of the next."
 (defun gnus-summary-next-unread-article ()
   "Select unread article after current one."
   (interactive)
-  (gnus-summary-next-article t (and gnus-auto-select-same
-                                   (gnus-summary-article-subject))))
+  (gnus-summary-next-article 
+   (or (not (eq gnus-summary-goto-unread 'never))
+       (gnus-summary-last-article-p (gnus-summary-article-number)))
+   (and gnus-auto-select-same
+       (gnus-summary-article-subject))))
 
 (defun gnus-summary-prev-article (&optional unread subject)
   "Select the article after the current one.
@@ -5382,8 +5391,11 @@ If UNREAD is non-nil, only unread articles are selected."
 (defun gnus-summary-prev-unread-article ()