From: Teodor Zlatanov Date: Thu, 16 Jan 2003 12:08:15 +0000 (+0000) Subject: (spam-get-article-as-filename): new function (unused for now) X-Git-Url: https://cgit.sxemacs.org/?a=commitdiff_plain;h=bf8f8aa321c5c308d551bbb843eb0c366e719bf3;p=gnus (spam-get-article-as-filename): new function (unused for now) (spam-get-article-as-buffer): new function (spam-get-article-as-string): use spam-get-article-as-buffer (spam-summary-prepare-exit): fixed bug, noticed by Malcolm Purvis --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e3888a670..02a7d6ee9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2003-01-16 Teodor Zlatanov + + * spam.el (spam-get-article-as-filename): new function (unused for now) + (spam-get-article-as-buffer): new function + (spam-get-article-as-string): use spam-get-article-as-buffer + (spam-summary-prepare-exit): fixed bug, noticed by Malcolm Purvis + 2003-01-15 ShengHuo ZHU * gnus-agent.el: Don't use `path'. diff --git a/lisp/spam.el b/lisp/spam.el index 1a4814ba6..86012dcf1 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -309,7 +309,7 @@ your main source of newsgroup names." (when (spam-group-spam-processor-stat-p gnus-newsgroup-name) (spam-stat-register-spam-routine)) - (when (spam-group-spam-processor-bogofilter-p gnus-newsgroup-name) + (when (spam-group-spam-processor-blacklist-p gnus-newsgroup-name) (spam-blacklist-register-routine)) (if spam-move-spam-nonspam-groups-only @@ -412,14 +412,31 @@ your main source of newsgroup names." 'line-end-position))) (defun spam-get-article-as-string (article) - (let ((article-string)) + (let ((article-buffer (spam-get-article-as-buffer article)) + article-string) + (when article-buffer + (save-window-excursion + (set-buffer article-buffer) + (setq article-string (buffer-string)))) + article-string)) + +(defun spam-get-article-as-buffer (article) + (let ((article-buffer)) (when (numberp article) (save-window-excursion (gnus-summary-goto-subject article) (gnus-summary-show-article t) - (set-buffer gnus-article-buffer) - (setq article-string (buffer-string)))) - article-string)) + (setq article-buffer (get-buffer gnus-article-buffer)))) + article-buffer)) + +(defun spam-get-article-as-filename (article) + (let ((article-filename)) + (when (numberp article) + (nnml-possibly-change-directory (gnus-group-real-name gnus-newsgroup-name)) + (setq article-filename (expand-file-name (int-to-string article) nnml-current-directory))) + (if (file-exists-p article-filename) + article-filename + nil))) (defun spam-fetch-field-from-fast (article) "Fetch the `from' field quickly, using the internal gnus-data-list function"