From: Lars Magne Ingebrigtsen Date: Fri, 29 Oct 2010 23:30:55 +0000 (+0200) Subject: Allow the user to say whether to split old messages or not in nnimap. X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=29e6eda39d4ff7e4a3fb82caf710446582ef3c03 Allow the user to say whether to split old messages or not in nnimap. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f31925d41..a7b059b11 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ 2010-10-29 Lars Magne Ingebrigtsen + * 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 (tiny change) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 1a09e0419..5bcda97ab 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -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 diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 4b6b50b82..5c4476f29 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -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)))) diff --git a/texi/ChangeLog b/texi/ChangeLog index 2fff53a39..778d36c69 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2010-10-29 Lars Magne Ingebrigtsen + + * gnus.texi (Client-Side IMAP Splitting): Mention + nnimap-unsplittable-articles. + 2010-10-29 Julien Danjou * gnus.texi (Finding the News): Remove references to obsoletes diff --git a/texi/gnus.texi b/texi/gnus.texi index 85f194caa..78711351b 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -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