]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/nnml.el
Fix auth-source-epa-make-gpg-token compilation (bug#21724)
[gnu-emacs] / lisp / gnus / nnml.el
index 05d0c902340c545273930f923044c628f4aaf67f..33eae1c166ec1836036bca3ccbe5e7a523356236 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nnml.el --- mail spool access for Gnus
 
-;; Copyright (C) 1995-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2015 Free Software Foundation, Inc.
 
 ;; Authors: Didier Verna <didier@xemacs.org> (adding compaction)
 ;;     Simon Josefsson <simon@josefsson.org>
@@ -178,7 +178,7 @@ non-nil.")
                   (> number nnmail-large-newsgroup)
                   (zerop (% count 20))
                   (nnheader-message 6 "nnml: Receiving headers... %d%%"
-                                    (/ (* count 100) number))))
+                                    (floor (* count 100.0) number))))
 
            (and (numberp nnmail-large-newsgroup)
                 (> number nnmail-large-newsgroup)
@@ -268,10 +268,35 @@ non-nil.")
                           (max (1+ (- (cdr active) (car active))) 0)
                           (car active) (cdr active) group)))))))
 
+(deffoo nnml-retrieve-groups (groups &optional server)
+  (when nnml-get-new-mail
+    (if (nnmail-get-new-mail-per-group)
+       (dolist (group groups)
+         (nnml-request-scan group server))
+      (nnml-request-scan nil server)))
+  (with-current-buffer nntp-server-buffer
+    (erase-buffer)
+    (dolist (group groups)
+      (let* ((entry (assoc group nnml-group-alist))
+            (active (nth 1 entry)))
+       (if (consp active)
+           (insert (format "211 %d %d %d %s\n"
+                           (max (1+ (- (cdr active) (car active))) 0)
+                           (car active) (cdr active) group))))))
+  'group)
+
 (deffoo nnml-request-scan (&optional group server)
   (setq nnml-article-file-alist nil)
   (nnml-possibly-change-directory group server)
-  (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group))
+  (cond
+   (group
+    (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory group))
+   ((nnmail-get-new-mail-per-group)
+    (nnml-request-list)
+    (dolist (entry nnml-group-alist)
+      (nnml-request-scan (car entry) server)))
+   (t
+    (nnmail-get-new-mail 'nnml 'nnml-save-incremental-nov nnml-directory nil))))
 
 (deffoo nnml-close-group (group &optional server)
   (setq nnml-article-file-alist nil)