2002-09-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-art.el (gnus-article-address-banner-alist): Doc fix.
+
+2002-09-11 Simon Josefsson <jas@extundo.com>
+
+ * nnimap.el (nnimap-expiry-target): Only expiry-target existing articles.
+ (nnimap-split-rule): Doc fix.
+ (nnimap-request-expire-articles): Cleanup code.
+
+2002-09-11 Katsumi Yamaoka <yamaoka@jpl.org>
From TSUCHIYA Masatoshi <tsuchiya@namazu.org>.
* gnus-art.el (gnus-article-address-banner-alist): New option.
directly.")
(defcustom gnus-article-address-banner-alist nil
- "Banner alist for free mail addresses.
+ "Alist of mail addresses and banners.
Each element has the form (ADDRESS . BANNER), where ADDRESS is a regexp
to match a mail address in the From: header, BANNER is one of a symbol
`signature', an item in `gnus-article-banner-alist', a regexp and nil.
If ADDRESS matches author's mail address, it will remove things like
advertisements. For example:
-\((\"@yahoo\\.co\\.jp\\\\'\" . \"\\n_+\\nDo You Yahoo!\\\\?\\n.*\\n.*\\n\"))
+\((\"@yoo-hoo\\.co\\.jp\\\\'\" . \"\\n_+\\nDo You Yoo-hoo!\\\\?\\n.*\\n.*\\n\"))
"
:type '(repeat
(cons
\(setq nnimap-split-rule '((\"INBOX.gnus-imap\" \"From:.*gnus-imap\")
(\"INBOX.junk\" \"Subject:.*buy\")))
-As you can see, `nnimap-split-rule' is a list of lists, where the first
-element in each \"rule\" is the name of the IMAP mailbox, and the
-second is a regexp that nnimap will try to match on the header to find
-a fit.
+As you can see, `nnimap-split-rule' is a list of lists, where the
+first element in each \"rule\" is the name of the IMAP mailbox (or the
+symbol `junk' if you want to remove the mail), and the second is a
+regexp that nnimap will try to match on the header to find a fit.
The second element can also be a function. In that case, it will be
called narrowed to the headers with the first element of the rule as
(when nnmail-cache-accepted-message-ids
(with-current-buffer nntp-server-buffer
(let (msgid)
- (and (setq msgid
+ (and (setq msgid
(nnmail-fetch-field "message-id"))
(nnmail-cache-insert msgid to-group)))))
;; Add the group-art list to the history list.
(defun nnimap-expiry-target (arts group server)
(unless (eq nnmail-expiry-target 'delete)
(with-temp-buffer
- (dolist (art (gnus-uncompress-sequence arts))
+ (dolist (art (imap-search (concat "UID "
+ (imap-range-to-message-set
+ (gnus-uncompress-sequence arts)))
+ nnimap-server-buffer))
(nnimap-request-article art group server (current-buffer))
;; hints for optimization in `nnimap-request-accept-article'
(let ((nnimap-current-move-article art)
(let ((artseq (gnus-compress-sequence articles)))
(when (and artseq (nnimap-possibly-change-group group server))
(with-current-buffer nnimap-server-buffer
- (if force
- (progn
- (nnimap-expiry-target artseq group server)
- (when (imap-message-flags-add (imap-range-to-message-set artseq)
- "\\Deleted")
- (setq articles nil)))
- (let ((days (or (and nnmail-expiry-wait-function
- (funcall nnmail-expiry-wait-function group))
- nnmail-expiry-wait)))
- (cond ((eq days 'immediate)
- (nnimap-expiry-target artseq group server)
- (when (imap-message-flags-add
- (imap-range-to-message-set artseq) "\\Deleted")
- (setq articles nil)))
- ((numberp days)
- (let ((oldarts (imap-search
- (format nnimap-expunge-search-string
- (imap-range-to-message-set artseq)
- (nnimap-date-days-ago days))))
- (imap-fetch-data-hook
- '(nnimap-request-expire-articles-progress)))
- (nnimap-expiry-target oldarts group server)
- (and oldarts
- (imap-message-flags-add
- (imap-range-to-message-set
- (gnus-compress-sequence oldarts))
- "\\Deleted")
- (setq articles (gnus-set-difference
- articles oldarts)))))))))))
+ (let ((days (or (and nnmail-expiry-wait-function
+ (funcall nnmail-expiry-wait-function group))
+ nnmail-expiry-wait)))
+ (cond (force
+ (nnimap-expiry-target artseq group server)
+ (when (imap-message-flags-add
+ (imap-range-to-message-set artseq) "\\Deleted")
+ (setq articles nil)))
+ ((eq days 'immediate)
+ (nnimap-expiry-target artseq group server)
+ (when (imap-message-flags-add
+ (imap-range-to-message-set artseq) "\\Deleted")
+ (setq articles nil)))
+ ((numberp days)
+ (let ((oldarts (imap-search
+ (format nnimap-expunge-search-string
+ (imap-range-to-message-set artseq)
+ (nnimap-date-days-ago days))))
+ (imap-fetch-data-hook
+ '(nnimap-request-expire-articles-progress)))
+ (nnimap-expiry-target oldarts group server)
+ (and oldarts
+ (imap-message-flags-add
+ (imap-range-to-message-set
+ (gnus-compress-sequence oldarts))
+ "\\Deleted")
+ (setq articles (gnus-set-difference
+ articles oldarts))))))))))
;; return articles not deleted
articles)
+2002-09-11 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (Article Hiding): Add a document for
+ gnus-article-address-banner-alist.
+
+2002-09-11 Simon Josefsson <jas@extundo.com>
+
+ * gnus.texi (Splitting in IMAP): Fix.
+
2002-09-10 Simon Josefsson <jas@extundo.com>
* gnus.texi (Other Marks): Fix.
@item W W B
@kindex W W B (\e$B35N,\e(B)
@findex gnus-article-strip-banner
+@vindex gnus-article-banner-alist
+@vindex gnus-article-address-banner-alist
@cindex banner
@cindex OneList
@cindex stripping advertisements
\e$B$O\e(B @code{gnus-article-banner-alist} \e$B$N@55,I=8=$KBP1~$7$?%7%s%\%k$G$"$k$3\e(B
\e$B$H$,$G$-$^$9!#\e(B
+\e$B%0%k!<%W$K$+$+$o$i$:!"5-;v$NAw?.<T\e(B
+\e$B$,\e(B @code{gnus-article-address-banner-alist} \e$B$K@_Dj$5$l$?!"$"$k%a!<%k%"%I\e(B
+\e$B%l%9$r;}$C$F$$$k$H$-$@$1!"9-9p$N$h$&$J$b$N$r1#$9$3$H$,$G$-$^$9!#\e(B
+
+@table @code
+@item gnus-article-address-banner-alist
+@vindex gnus-article-address-banner-alist
+\e$B%a!<%k%"%I%l%9$H%P%J!<$NO"A[%j%9%H$G$9!#$=$l$>$l$NMWAG\e(B
+\e$B$O\e(B @code{(ADDRESS . BANNER)} \e$B$N7A<0$r;}$A!"$3$3$G\e(B ADDRESS \e$B$O\e(B From \e$B%X%C%@!<\e(B
+\e$B$K$"$k%a!<%k%"%I%l%9$K%^%C%A$9$k@55,I=8=!"\e(BBANNER \e$B$O%7%s%\\e(B
+\e$B%k\e(B @code{signature}\e$B!"\e(B@code{gnus-article-banner-alist} \e$B$NMWAG!"@55,I=8=$^\e(B
+\e$B$?$O\e(B @code{nil} \e$B$N$&$A$N0l$D$G$9!#\e(BADDRESS \e$B$,Cx<T$N%a!<%k%"%I%l%9$K%^%C%A\e(B
+\e$B$9$k$H!"9-9p$N$h$&$J$b$N$r>C$7$^$9!#Nc$($P!"Aw?.<T\e(B
+\e$B$,\e(B @samp{hail@@yoo-hoo.co.jp} \e$B$H$$$&%a!<%k%"%I%l%9$r;}$C$F$$$F!"H`$,Aw?.\e(B
+\e$B$9$k$9$Y$F$N5-;v$K\e(B @samp{Do You Yoo-hoo!?} \e$B$N$h$&$J$b$N$,$"$k>l9g!"0J2<\e(B
+\e$B$NMWAG$G$=$l$i$r>C$9$3$H$,$G$-$^$9!#\e(B
+
+@lisp
+("@@yoo-hoo\.co\.jp\\'" . "\n_+\nDo You Yoo-hoo!\\?\n.*\n.*\n")
+@end lisp
+@end table
+
@item W W c
@kindex W W c (\e$B35N,\e(B)
@findex gnus-article-hide-citation
("INBOX.lists.\\1" "^Sender: owner-\\([a-z-]+\\)@@")
@end lisp
+\e$B:G=i$NMWAG$r%7%s%\%k\e(B @code{junk} \e$B$K$7$F!"%^%C%A$9$k%a%C%;!<%8$rC1$K>C$9\e(B
+\e$B$Y$-$G$"$k$3$H$rI=$9$3$H$b$G$-$^$9!#5$$rIU$1$F;H$C$F2<$5$$!#\e(B
+
\e$BFs$DL\$NMWAG$O4X?t$G$"$k$3$H$b$G$-$^$9!#$=$N>l9g$O!"5-;v$N%X%C%@!<$,$"$k\e(B
\e$B%P%C%U%!$G!"$=$N5,B'$N:G=i$NMWAG$r0z?t$H$7$F8F$P$l$^$9!#%a!<%k$,$=$N%0%k!<\e(B
\e$B%W$KB0$9$k$H9M$($k>l9g$O!"\e(B@code{nil} \e$B$G$J$$CM$rJV$9I,MW$,$"$j$^$9!#\e(B
@item W W B
@kindex W W B (Summary)
@findex gnus-article-strip-banner
+@vindex gnus-article-banner-alist
+@vindex gnus-article-address-banner-alist
@cindex banner
@cindex OneList
@cindex stripping advertisements
corresponding regular expression in @code{gnus-article-banner-alist} is
used.
+Regardless of a group, you can hide things like advertisements only when
+the sender of an article has a certain mail address specified in
+@code{gnus-article-address-banner-alist}.
+
+@table @code
+
+@item gnus-article-address-banner-alist
+@vindex gnus-article-address-banner-alist
+Alist of mail addresses and banners. Each element has the form
+@code{(ADDRESS . BANNER)}, where ADDRESS is a regexp matching a mail
+address in the From header, BANNER is one of a symbol @code{signature},
+an item in @code{gnus-article-banner-alist}, a regexp and @code{nil}.
+If ADDRESS matches author's mail address, it will remove things like
+advertisements. For example, if a sender has the mail address
+@samp{hail@@yoo-hoo.co.jp} and there is a banner something like
+@samp{Do You Yoo-hoo!?} in all articles he sends, you can use the
+following element to remove them:
+
+@lisp
+("@@yoo-hoo\.co\.jp\\'" . "\n_+\nDo You Yoo-hoo!\\?\n.*\n.*\n")
+@end lisp
+
+@end table
+
@item W W c
@kindex W W c (Summary)
@findex gnus-article-hide-citation
("INBOX.lists.\\1" "^Sender: owner-\\([a-z-]+\\)@@")
@end lisp
+The first element can also be the symbol @code{junk} to indicate that
+matching messages should simply be deleted. Use with care.
+
The second element can also be a function. In that case, it will be
called with the first element of the rule as the argument, in a buffer
containing the headers of the article. It should return a non-nil value