From c9f8c672c0b795e345c61135e1bbd21554e500d8 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 4 Dec 2003 23:28:11 +0000 Subject: [PATCH] Synch to Gnus 200312042316. --- lisp/ChangeLog | 5 +++++ lisp/spam-report.el | 20 ++++++++++---------- texi/ChangeLog | 6 ++++++ texi/gnus-ja.texi | 19 ++++++++++--------- texi/gnus.texi | 27 +++++++++++++++------------ 5 files changed, 46 insertions(+), 31 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 374dedf..af12f2e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2003-12-04 Teodor Zlatanov + + * spam-report.el (spam-report-gmane): iterate over articles + instead of a single one; remove interactive usage + 2003-12-03 Katsumi Yamaoka * dns.el: Fix misplaced eval-when-compile. diff --git a/lisp/spam-report.el b/lisp/spam-report.el index cde38f8..e10639b 100644 --- a/lisp/spam-report.el +++ b/lisp/spam-report.el @@ -67,18 +67,18 @@ instead." spam-report-url-ping-mm-url)) :group 'spam-report) -(defun spam-report-gmane (article) +(defun spam-report-gmane (&rest articles) "Report an article as spam through Gmane" - (interactive "nEnter the article number: ") - (when (and gnus-newsgroup-name - (or (null spam-report-gmane-regex) - (string-match spam-report-gmane-regex gnus-newsgroup-name))) - (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article) + (dolist (article articles) + (when (and gnus-newsgroup-name + (or (null spam-report-gmane-regex) + (string-match spam-report-gmane-regex gnus-newsgroup-name))) + (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article) (if spam-report-gmane-use-article-number (spam-report-url-ping "spam.gmane.org" - (format "/%s:%d" - (gnus-group-real-name gnus-newsgroup-name) - article)) + (format "/%s:%d" + (gnus-group-real-name gnus-newsgroup-name) + article)) (with-current-buffer nntp-server-buffer (gnus-request-head article gnus-newsgroup-name) (goto-char (point-min)) @@ -89,7 +89,7 @@ instead." (gnus-message 10 "Reporting spam through URL %s..." url) (spam-report-url-ping host report)) (gnus-message 10 "Could not find X-Report-Spam in article %d..." - article)))))) + article))))))) (defun spam-report-url-ping (host report) "Ping a host through HTTP, addressing a specific GET resource using diff --git a/texi/ChangeLog b/texi/ChangeLog index 45cd99e..4e552a9 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2003-12-04 Teodor Zlatanov + + * gnus.texi (SpamAssassin, Fancy Mail Splitting): add + save-restriction before (widen) in the example. From Kevin Ryde + . + 2003-12-03 Simon Josefsson * emacs-mime.texi (Flowed text): Fix. diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 124a119..27c859f 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -13181,18 +13181,19 @@ UNDELETED} はおそらくたいていの人には最良の選択でしょうが、ときど @lisp (defun split-on-body () (save-excursion - (widen) - (goto-char (point-min)) - (when (re-search-forward "Some.*string" nil t) - "string.group"))) + (save-restriction + (widen) + (goto-char (point-min)) + (when (re-search-forward "Some.*string" nil t) + "string.group")))) @end lisp @var{function} が走らされるとき、バッファはメッセージの部分に狭められま -す。それが、上記の例で @code{save-excursion} の後で @code{(widen)} が呼 -ばれる必要がある理由です。さらに nnimap バックエンドの場合、ディフォルト -では記事のボディがダウンロードされないことに注意して下さい。それをするた -めには、@code{nnimap-split-download-body} を t に設定する必要がありま -す (@pxref{Splitting in IMAP})。 +す。それが上記の例で @code{save-excursion} と @code{save-restriction} の +後で @code{(widen)} が呼ばれる必要がある理由です。さらに nnimap バックエ +ンドの場合、ディフォルトでは記事のボディがダウンロードされないことに注意 +して下さい。それをするためには @code{nnimap-split-download-body} を t に +設定する必要があります (@pxref{Splitting in IMAP})。 @item (! @var{func} @var{split}) 分割がリストで、最初の要素が @code{!} であると @var{split} が実行され、 diff --git a/texi/gnus.texi b/texi/gnus.texi index e593b03..7286e92 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -13937,18 +13937,20 @@ body of the messages: @lisp (defun split-on-body () (save-excursion - (widen) - (goto-char (point-min)) - (when (re-search-forward "Some.*string" nil t) - "string.group"))) + (save-restriction + (widen) + (goto-char (point-min)) + (when (re-search-forward "Some.*string" nil t) + "string.group")))) @end lisp The buffer is narrowed to the message in question when @var{function} is run. That's why @code{(widen)} needs to be called after -@code{save-excursion} in the example above. Also note that with the -nnimap backend, message bodies will not be downloaded by default. You -need to set @code{nnimap-split-download-body} to t to do that -(@pxref{Splitting in IMAP}). +@code{save-excursion} and @code{save-restriction} in the example +above. Also note that with the nnimap backend, message bodies will +not be downloaded by default. You need to set +@code{nnimap-split-download-body} to t to do that (@pxref{Splitting in +IMAP}). @item (! @var{func} @var{split}) If the split is a list, and the first element is @code{!}, then @@ -22299,10 +22301,11 @@ call the external tools during splitting. Example fancy split method: ...)) (defun kevin-spamassassin () (save-excursion - (widen) - (if (eq 1 (call-process-region (point-min) (point-max) - "spamc" nil nil nil "-c")) - "spam"))) + (save-restriction + (widen) + (if (eq 1 (call-process-region (point-min) (point-max) + "spamc" nil nil nil "-c")) + "spam")))) @end lisp Note that with the nnimap backend, message bodies will not be -- 1.7.10.4