Allow the user to say whether to split old messages or not in nnimap.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 29 Oct 2010 23:30:55 +0000 (01:30 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 29 Oct 2010 23:30:55 +0000 (01:30 +0200)
lisp/ChangeLog
lisp/gnus-util.el
lisp/nnimap.el
texi/ChangeLog
texi/gnus.texi

index f31925d..a7b059b 100644 (file)
@@ -1,7 +1,11 @@
 2010-10-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-util.el (gnus-list-memq-of-list): New function.
+
        * nnimap.el (nnimap-split-incoming-mail): Note that the INBOX has been
        selected.
+       (nnimap-unsplittable-articles): New slot.
+       (nnimap-new-articles): Use it.
 
 2010-10-29  Stephen Berman  <stephen.berman@gmx.net>  (tiny change)
 
index 1a09e04..5bcda97 100644 (file)
@@ -1974,6 +1974,14 @@ Sizes are in pixels."
                    image)))
       image)))
 
+(defun gnus-list-memq-of-list (elements list)
+  "Return non-nil if any of the members of ELEMENTS are in LIST."
+  (let ((found nil))
+    (dolist (elem elements)
+      (setq found (or found
+                     (memq elem list))))
+    found))
+
 (provide 'gnus-util)
 
 ;;; gnus-util.el ends here
index 4b6b50b..5c4476f 100644 (file)
@@ -78,6 +78,9 @@ Uses the same syntax as nnmail-split-methods")
 (defvoo nnimap-split-fancy nil
   "Uses the same syntax as nnmail-split-fancy.")
 
+(defvoo nnimap-unsplittable-articles '(%Deleted %Seen)
+  "Articles with the flags in the list will not be considered when splitting.")
+
 (make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'"
                        "Emacs 24.1")
 
@@ -1685,9 +1688,8 @@ textual parts.")
 (defun nnimap-new-articles (flags)
   (let (new)
     (dolist (elem flags)
-      (when (or (null (cdr elem))
-               (and (not (memq '%Deleted (cdr elem)))
-                    (not (memq '%Seen (cdr elem)))))
+      (unless (gnus-list-memq-of-list nnimap-unsplittable-articles
+                                     (cdr elem))
        (push (car elem) new)))
     (gnus-compress-sequence (nreverse new))))
 
index 2fff53a..778d36c 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus.texi (Client-Side IMAP Splitting): Mention
+       nnimap-unsplittable-articles.
+
 2010-10-29  Julien Danjou  <julien@danjou.info>
 
        * gnus.texi (Finding the News): Remove references to obsoletes
index 85f194c..7871135 100644 (file)
@@ -14929,6 +14929,11 @@ use the value of the @code{nnmail-split-methods} variable.
 @item nnimap-split-fancy
 Uses the same syntax as @code{nnmail-split-fancy}.
 
+@item nnimap-unsplittable-articles
+List of flag symbols to ignore when doing splitting.  That is,
+articles that have these flags won't be considered when splitting.
+The default is @samp{(%Deleted %Seen)}.
+
 @end table