Importing Gnus v5.8.7.
[elisp/gnus.git-] / lisp / nnmail.el
index a5ff525..8b81eb3 100644 (file)
@@ -191,6 +191,12 @@ This variable is obsolete; `mail-sources' should be used instead."
   :group 'nnmail-procmail
   :type 'boolean)
 
+(defcustom nnmail-scan-directory-mail-source-once nil
+  "*If non-nil, scan all incoming procmail sorted mails once.
+It scans low-level sorted spools even when not required."
+  :group 'nnmail-procmail
+  :type 'boolean)
+
 (defcustom nnmail-delete-file-function 'delete-file
   "Function called to delete files in some mail backends."
   :group 'nnmail-files
@@ -462,7 +468,7 @@ parameter.  It should return nil, `warn' or `delete'."
     (condition-case ()
        (let ((coding-system-for-read nnmail-file-coding-system)
              (auto-mode-alist (mm-auto-mode-alist))
-             (pathname-coding-system nnmail-pathname-coding-system))
+             (file-name-coding-system nnmail-pathname-coding-system))
          (insert-file-contents file)
          t)
       (file-error nil))))
@@ -1520,6 +1526,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
          nil))
        ;; Hack to only fetch the contents of a single group's spool file.
        (when (and (eq (car source) 'directory)
+                  (null nnmail-scan-directory-mail-source-once)
                   group)
          (mail-source-bind (directory source)
            (setq source (append source
@@ -1616,7 +1623,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
 (defun nnmail-write-region (start end filename &optional append visit lockname)
   "Do a `write-region', and then set the file modes."
   (let ((coding-system-for-write nnmail-file-coding-system)
-       (pathname-coding-system nnmail-pathname-coding-system))
+       (file-name-coding-system nnmail-pathname-coding-system))
     (write-region start end filename append visit lockname)
     (set-file-modes filename nnmail-default-file-modes)))