* gnus-sum.el (gnus-summary-find-next): Indent.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 13 May 2003 19:34:06 +0000 (19:34 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 13 May 2003 19:34:06 +0000 (19:34 +0000)
(gnus-summary-find-prev): Ditto.
(gnus-summary-catchup): Doc fix.
(gnus-summary-mark-current-read-and-unread-as-read): New function.
(gnus-summary-catchup): Really mark after point.

lisp/ChangeLog
lisp/gnus-sum.el

index a1de86b..592c784 100644 (file)
@@ -1,5 +1,11 @@
 2003-05-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-sum.el (gnus-summary-find-next): Indent.
+       (gnus-summary-find-prev): Ditto.
+       (gnus-summary-catchup): Doc fix.
+       (gnus-summary-mark-current-read-and-unread-as-read): New function.
+       (gnus-summary-catchup): Really mark after point.
+
        * gnus-util.el (gnus-user-date): Use %d instead of %m.
        (gnus-user-date): Use floating point time so that we don't get
        overflows. 
index 6256c04..d5c6570 100644 (file)
@@ -6095,7 +6095,8 @@ If EXCLUDE-GROUP, do not go to this group."
       (gnus-group-best-unread-group exclude-group))))
 
 (defun gnus-summary-find-next (&optional unread article backward)
-  (if backward (gnus-summary-find-prev unread article)
+  (if backward
+      (gnus-summary-find-prev unread article)
     (let* ((dummy (gnus-summary-article-intangible-p))
           (article (or article (gnus-summary-article-number)))
           (data (gnus-data-find-list article))
@@ -6110,14 +6111,18 @@ If EXCLUDE-GROUP, do not go to this group."
                      (progn
                        (while data
                           (unless (memq (gnus-data-number (car data)) 
-                                        (cond ((eq gnus-auto-goto-ignores 'always-undownloaded)
-                                               gnus-newsgroup-undownloaded)
-                                              (gnus-plugged
-                                               nil)
-                                              ((eq gnus-auto-goto-ignores 'unfetched)
-                                               gnus-newsgroup-unfetched)
-                                              ((eq gnus-auto-goto-ignores 'undownloaded)
-                                               gnus-newsgroup-undownloaded)))
+                                        (cond
+                                        ((eq gnus-auto-goto-ignores
+                                             'always-undownloaded)
+                                         gnus-newsgroup-undownloaded)
+                                        (gnus-plugged
+                                         nil)
+                                        ((eq gnus-auto-goto-ignores
+                                             'unfetched)
+                                         gnus-newsgroup-unfetched)
+                                        ((eq gnus-auto-goto-ignores
+                                             'undownloaded)
+                                         gnus-newsgroup-undownloaded)))
                             (when (gnus-data-unread-p (car data))
                               (setq result (car data)
                                     data nil)))
@@ -6142,14 +6147,18 @@ If EXCLUDE-GROUP, do not go to this group."
                    (progn
                      (while data
                         (unless (memq (gnus-data-number (car data))
-                                      (cond ((eq gnus-auto-goto-ignores 'always-undownloaded)
-                                             gnus-newsgroup-undownloaded)
-                                            (gnus-plugged
-                                             nil)
-                                            ((eq gnus-auto-goto-ignores 'unfetched)
-                                             gnus-newsgroup-unfetched)
-                                            ((eq gnus-auto-goto-ignores 'undownloaded)
-                                             gnus-newsgroup-undownloaded)))
+                                      (cond
+                                      ((eq gnus-auto-goto-ignores
+                                           'always-undownloaded)
+                                       gnus-newsgroup-undownloaded)
+                                      (gnus-plugged
+                                       nil)
+                                      ((eq gnus-auto-goto-ignores
+                                           'unfetched)
+                                       gnus-newsgroup-unfetched)
+                                      ((eq gnus-auto-goto-ignores
+                                           'undownloaded)
+                                       gnus-newsgroup-undownloaded)))
                           (when (gnus-data-unread-p (car data))
                             (setq result (car data)
                                   data nil)))
@@ -10033,6 +10042,14 @@ The difference between N and the number of marks cleared is returned."
       (gnus-summary-mark-article gnus-current-article
                                 (or new-mark gnus-read-mark)))))
 
+(defun gnus-summary-mark-current-read-and-unread-as-read (&optional new-mark)
+  "Intended to be used by `gnus-summary-mark-article-hook'."
+  (let ((mark (gnus-summary-article-mark)))
+    (when (or (gnus-unread-mark-p mark)
+             (gnus-read-mark-p mark))
+      (gnus-summary-mark-article (gnus-summary-article-number)
+                                (or new-mark gnus-read-mark)))))
+
 (defun gnus-summary-mark-unread-as-ticked ()
   "Intended to be used by `gnus-summary-mark-article-hook'."
   (when (memq gnus-current-article gnus-newsgroup-unreads)
@@ -10135,10 +10152,14 @@ even ticked and dormant ones."
 If prefix argument ALL is non-nil, ticked and dormant articles will
 also be marked as read.
 If QUIETLY is non-nil, no questions will be asked.
+
 If TO-HERE is non-nil, it should be a point in the buffer.  All
-articles before (after, if REVERSE is set) this point will be marked as read.
+articles before (after, if REVERSE is set) this point will be marked
+as read.
+
 Note that this function will only catch up the unread article
 in the current summary buffer limitation.
+
 The number of articles marked as read is returned."
   (interactive "P")
   (prog1
@@ -10172,7 +10193,8 @@ The number of articles marked as read is returned."
            (if (and to-here reverse)
                (progn
                  (goto-char to-here)
-                 (gnus-summary-mark-read-and-unread-as-read gnus-catchup-mark)
+                 (gnus-summary-mark-current-read-and-unread-as-read
+                  gnus-catchup-mark)
                  (while (gnus-summary-find-next (not all))
                    (gnus-summary-mark-article-as-read gnus-catchup-mark)))
              (when (gnus-summary-first-subject (not all))
@@ -10206,8 +10228,8 @@ If ALL is non-nil, also mark ticked and dormant articles as read."
        ;; We check that there are unread articles.
        (when (or all (gnus-summary-find-next))
          (gnus-summary-catchup all t beg nil t)))))
-
   (gnus-summary-position-point))
+
 (defun gnus-summary-catchup-all (&optional quietly)
   "Mark all articles in this newsgroup as read.
 This command is dangerous.  Normally, you want \\[gnus-summary-catchup]