Split -request-update-info into -request-marks and -update-info.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 23 Sep 2010 17:00:43 +0000 (19:00 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 23 Sep 2010 17:00:43 +0000 (19:00 +0200)
This allows backends that really need to update the infos to be run,
without having to go through all the marks stuff that's really slow.

lisp/ChangeLog
lisp/gnus-int.el
lisp/gnus-start.el
lisp/nnfolder.el
lisp/nnmaildir.el
lisp/nnmairix.el
lisp/nnml.el
lisp/nntp.el
lisp/nnweb.el

index 6a2563e..78809c3 100644 (file)
@@ -1,5 +1,20 @@
 2010-09-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-start.el (gnus-get-unread-articles): Allow backends to update
+       the info.
+       (gnus-get-unread-articles): Only call updatep on backends that support
+       it.
+
+       * nnweb.el (nnweb-request-update-info): NOOP.
+
+       * nnmaildir.el (nnmaildir-request-marks): Renamed from -update-info.
+
+       * nnfolder.el (nnfolder-request-marks): Renamed from -update-info,
+       since it only deals with marks.
+
+       * gnus-int.el (gnus-request-marks): Renamed gnus-request-update-info to
+       gnus-request-marks, and make a new gnus-request-update-info.
+
        * nnimap.el (nnimap-update-info): When UIDNEXT is present, use that for
        the active instead of the high number, which is usually too low.
 
index df7f979..e9d4e21 100644 (file)
@@ -584,7 +584,14 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
               (and group (gnus-group-real-name group))
               (nth 1 gnus-command-method)))))
 
-(defsubst gnus-request-update-info (info gnus-command-method)
+(defun gnus-request-update-info (info gnus-command-method)
+  (when (stringp gnus-command-method)
+    (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
+  (funcall (gnus-get-function gnus-command-method 'request-update-info)
+          (gnus-group-real-name (gnus-info-group info)) info
+          (nth 1 gnus-command-method)))
+
+(defsubst gnus-request-marks (info gnus-command-method)
   "Request that GNUS-COMMAND-METHOD update INFO."
   (when (stringp gnus-command-method)
     (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
index 77ce8ee..fdf6b92 100644 (file)
@@ -1765,11 +1765,14 @@ If SCAN, request a scan of that group as well."
     (dolist (elem type-cache)
       (destructuring-bind (method method-type infos early-data) elem
        (when (and method infos)
-         ;; See if any of the groups from this method require updating.
-         (gnus-read-active-for-groups method infos early-data)
-         (dolist (info infos)
-           (inline (gnus-get-unread-articles-in-group
-                    info (gnus-active (gnus-info-group info))))))))
+         (let ((updatep (gnus-check-backend-function
+                         'request-update-info (car method))))
+           ;; See if any of the groups from this method require updating.
+           (gnus-read-active-for-groups method infos early-data)
+           (dolist (info infos)
+             (inline (gnus-get-unread-articles-in-group
+                      info (gnus-active (gnus-info-group info))
+                      updatep)))))))
     (gnus-message 6 "Checking new news...done")))
 
 (defun gnus-method-rank (type method)
index 1e0a950..c3d0d1c 100644 (file)
@@ -1202,7 +1202,7 @@ This command does not work if you use short group names."
     (nnfolder-save-marks group server))
   nil)
 
-(deffoo nnfolder-request-update-info (group info &optional server)
+(deffoo nnfolder-request-marks (group info &optional server)
   ;; Change servers.
   (when (and server
             (not (nnfolder-server-opened server)))
index 5b50ddb..8a018dc 100644 (file)
@@ -916,7 +916,7 @@ by nnmaildir-request-article.")
                  "\n")))))
   'group)
 
-(defun nnmaildir-request-update-info (gname info &optional server)
+(defun nnmaildir-request-marks (gname info &optional server)
   (let ((group (nnmaildir--prepare server gname))
        pgname flist always-marks never-marks old-marks dotfile num dir
        markdirs marks mark ranges markdir article read end new-marks ls
index 26d95b2..f38ffd3 100644 (file)
@@ -705,7 +705,7 @@ Other back ends might or might not work.")
 
 (autoload 'nnimap-request-update-info-internal "nnimap")
 
-(deffoo nnmairix-request-update-info (group info &optional server)
+(deffoo nnmairix-request-marks (group info &optional server)
 ;; propagate info from underlying IMAP folder to nnmairix group
 ;; This is currently experimental and must be explicitly activated
 ;; with nnmairix-propagate-marks-to-nnmairix-group
index d05485b..42b5321 100644 (file)
@@ -1047,7 +1047,7 @@ Use the nov database for the current group if available."
     (nnml-save-marks group server))
   nil)
 
-(deffoo nnml-request-update-info (group info &optional server)
+(deffoo nnml-request-marks (group info &optional server)
   (nnml-possibly-change-directory group server)
   (when (and (not nnml-marks-is-evil) (nnml-marks-changed-p group server))
     (nnheader-message 8 "Updating marks for %s..." group)
index 50f11ad..1bf2ce1 100644 (file)
@@ -1130,7 +1130,7 @@ command whose response triggered the error."
     (nntp-save-marks group server))
   nil)
 
-(deffoo nntp-request-update-info (group info &optional server)
+(deffoo nntp-request-marks (group info &optional server)
   (when (and (not nntp-marks-is-evil)
             nntp-marks-file-name)
     (nntp-possibly-create-directory group server)
index fceb2a3..1cfa7a4 100644 (file)
@@ -193,8 +193,7 @@ Valid types include `google', `dejanews', and `gmane'.")
     (nnmail-generate-active (list (assoc server nnweb-group-alist)))
     t))
 
-(deffoo nnweb-request-update-info (group info &optional server)
-  (nnweb-possibly-change-server group server))
+(deffoo nnweb-request-update-info (group info &optional server))
 
 (deffoo nnweb-asynchronous-p ()
   nil)