(spam-get-article-as-filename): new function (unused for now)
authorTeodor Zlatanov <tzz@lifelogs.com>
Thu, 16 Jan 2003 12:08:15 +0000 (12:08 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Thu, 16 Jan 2003 12:08:15 +0000 (12:08 +0000)
(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

lisp/ChangeLog
lisp/spam.el

index e3888a6..02a7d6e 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-16  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * 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  <zsh@cs.rochester.edu>
  
        * gnus-agent.el: Don't use `path'.
index 1a4814b..86012dc 100644 (file)
@@ -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"