]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/gnus-agent.el
Update copyright year to 2016
[gnu-emacs] / lisp / gnus / gnus-agent.el
index 432aabbc4ad293fa886a9cfd53c1047e5d76757d..9219ce04c1fb140659d4aed01faa4b76ce9ef874 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-agent.el --- unplugged support for Gnus
 
-;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2016 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; This file is part of GNU Emacs.
@@ -868,8 +868,9 @@ be a select method."
                      (not (eq gnus-agent-synchronize-flags 'ask)))
                 (and (eq gnus-agent-synchronize-flags 'ask)
                      (gnus-y-or-n-p
-                      (format "Synchronize flags on server `%s'? "
-                              (cadr method))))))
+                      (gnus-format-message
+                       "Synchronize flags on server `%s'? "
+                       (cadr method))))))
     (gnus-agent-synchronize-flags-server method)))
 
 ;;;###autoload
@@ -1721,7 +1722,7 @@ and that there are no duplicates."
               (or backed-up
                   (setq backed-up (gnus-agent-backup-overview-buffer)))
              (gnus-message 1
-                           "Overview buffer contains garbage '%s'."
+                           "Overview buffer contains garbage `%s'."
                            (buffer-substring
                             p (point-at-eol))))
             ((= cur prev-num)
@@ -1901,7 +1902,7 @@ article numbers will be returned."
 
       (when articles
        (gnus-message
-        10 "gnus-agent-fetch-headers: undownloaded articles are '%s'"
+        10 "gnus-agent-fetch-headers: undownloaded articles are `%s'"
         (gnus-compress-sequence articles t)))
 
       (with-current-buffer nntp-server-buffer
@@ -4121,8 +4122,8 @@ CLEAN is obsolete and ignored."
 (defun gnus-agent-group-covered-p (group)
   (gnus-agent-method-p (gnus-group-method group)))
 
-(defun gnus-agent-update-files-total-fetched-for
-  (group delta &optional method path)
+(defun gnus-agent-update-files-total-fetched-for (group delta
+                                                       &optional method path)
   "Update, or set, the total disk space used by the articles that the
 agent has fetched."
   (when gnus-agent-total-fetched-hashtb
@@ -4135,27 +4136,29 @@ agent has fetched."
                       (gnus-sethash path (make-list 3 0)
                                     gnus-agent-total-fetched-hashtb)))
            (file-name-coding-system nnmail-pathname-coding-system))
-       (when (listp delta)
-        (if delta
-            (let ((sum 0.0)
+       (when (file-exists-p path)
+        (when (listp delta)
+          (if delta
+              (let ((sum 0.0)
+                    file)
+                (while (setq file (pop delta))
+                  (incf sum (float (or (nth 7 (file-attributes
+                                               (nnheader-concat
+                                                path
+                                                (if (numberp file)
+                                                    (number-to-string file)
+                                                  file)))) 0))))
+                (setq delta sum))
+            (let ((sum (- (nth 2 entry)))
+                  (info (directory-files-and-attributes
+                         path nil "^-?[0-9]+$" t))
                   file)
-              (while (setq file (pop delta))
-                (incf sum (float (or (nth 7 (file-attributes
-                                             (nnheader-concat
-                                              path
-                                              (if (numberp file)
-                                                  (number-to-string file)
-                                                file)))) 0))))
-              (setq delta sum))
-          (let ((sum (- (nth 2 entry)))
-                (info (directory-files-and-attributes path nil "^-?[0-9]+$" t))
-                file)
-            (while (setq file (pop info))
-              (incf sum (float (or (nth 8 file) 0))))
-            (setq delta sum))))
+              (while (setq file (pop info))
+                (incf sum (float (or (nth 8 file) 0))))
+              (setq delta sum))))
 
-       (setq gnus-agent-need-update-total-fetched-for t)
-       (incf (nth 2 entry) delta)))))
+        (setq gnus-agent-need-update-total-fetched-for t)
+        (incf (nth 2 entry) delta))))))
 
 (defun gnus-agent-update-view-total-fetched-for
   (group agent-over &optional method path)