Don't message if we're fetching mail from a file, and the file doesn't exist.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 5 Sep 2010 15:04:59 +0000 (17:04 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 5 Sep 2010 15:04:59 +0000 (17:04 +0200)
This avoids noise when scanning for new mail.

lisp/ChangeLog
lisp/mail-source.el

index 5e962a9..039ddb1 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * mail-source.el (mail-source-fetch): Don't message if we're fetching
+       mail from a file, and the file doesn't exist.
+
        * imap.el (imap-log): New convenience function used throughout instead
        of repeating the same code all over the place.
 
index 7a62686..d3ceb6d 100644 (file)
@@ -544,11 +544,16 @@ Return the number of files that were found."
   (mail-source-bind-common source
     (if (or mail-source-plugged plugged)
        (save-excursion
-         (nnheader-message 4 "%sReading incoming mail from %s..."
-                           (if method
-                               (format "%s: " method)
-                             "")
-                           (car source))
+         ;; Special-case the `file' handler since it's so common and
+         ;; just adds noise.
+         (when (or (not (eq (car source) 'file))
+                   (mail-source-bind (file source)
+                     (file-exists-p path)))
+           (nnheader-message 4 "%sReading incoming mail from %s..."
+                             (if method
+                                 (format "%s: " method)
+                               "")
+                             (car source)))
          (let ((function (cadr (assq (car source) mail-source-fetcher-alist)))
                (found 0))
            (unless function