gnus-notifications: add actions support
[gnus] / lisp / mail-source.el
index 6e6ef76..ad66fec 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mail-source.el --- functions for fetching mail
 
-;; Copyright (C) 1999-2011  Free Software Foundation, Inc.
+;; Copyright (C) 1999-2012  Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
@@ -721,12 +721,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile)
       ;; Return whether we moved successfully or not.
       to)))
 
-(defun mail-source-movemail-and-remove (from to)
-  "Move FROM to TO using movemail, then remove FROM if empty."
-  (or (not (mail-source-movemail from to))
-      (not (zerop (nth 7 (file-attributes from))))
-      (delete-file from)))
-
 (defun mail-source-fetch-with-program (program)
   (eq 0 (call-process shell-file-name nil nil nil
                      shell-command-switch program)))
@@ -1017,6 +1011,7 @@ This only works when `display-time' is enabled."
          (dolist (file (directory-files (concat path subdir) t))
            (when (and (not (file-directory-p file))
                       (not (if function
+                               ;; `function' should return nil if successful.
                                (funcall function file mail-source-crash-box)
                              (let ((coding-system-for-write
                                     mm-text-coding-system)
@@ -1035,7 +1030,8 @@ This only works when `display-time' is enabled."
 ;;;                              (insert "\n\n")
                                  ;; MMDF mail format
                                  (insert "\001\001\001\001\n"))
-                               (delete-file file)))))
+                               (delete-file file)
+                               nil))))
              (incf found (mail-source-callback callback file))
              (mail-source-delete-crash-box)))))
       found)))