(elsp-bsfilter-list-spam-files): Fix the
authorhmurata <hmurata>
Sun, 27 Aug 2006 14:30:46 +0000 (14:30 +0000)
committerhmurata <hmurata>
Sun, 27 Aug 2006 14:30:46 +0000 (14:30 +0000)
argument BUFFER of `call-process'.

elmo/ChangeLog
elmo/elsp-bsfilter.el

index f9b9951..ce6df16 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-27  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elsp-bsfilter.el (elsp-bsfilter-list-spam-files): Fix the
+       argument BUFFER of `call-process'.
+
 2006-08-27  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * elsp-bsfilter.el (elsp-bsfilter-call-bsfilter): Remove nil from
index ab7f53d..9ba26af 100644 (file)
          (if register elmo-spam-bsfilter-update-switch)))))
 
 (defsubst elsp-bsfilter-list-spam-files (targets)
-  (apply
-   #'call-process
-   elmo-spam-bsfilter-shell-program
-   nil
-   (list t (if elmo-spam-bsfilter-debug
-              (get-buffer-create "*Debug ELMO Bsfilter*")))
-   nil
-   (append (if elmo-spam-bsfilter-shell-switch
-              (list elmo-spam-bsfilter-shell-switch))
-          (if elmo-spam-bsfilter-program
-              (list elmo-spam-bsfilter-program))
-          elmo-spam-bsfilter-args
-          (list "--list-spam")
-          (if elmo-spam-bsfilter-database-directory
-              (list "--homedir" elmo-spam-bsfilter-database-directory))
-          targets)))
+  (let ((temp-file (and elmo-spam-bsfilter-debug
+                       (make-temp-file "elsp-bserror"))))
+    (unwind-protect
+       (apply
+        #'call-process
+        elmo-spam-bsfilter-shell-program
+        nil
+        (list t temp-file)
+        nil
+        (append (if elmo-spam-bsfilter-shell-switch
+                    (list elmo-spam-bsfilter-shell-switch))
+                (if elmo-spam-bsfilter-program
+                    (list elmo-spam-bsfilter-program))
+                elmo-spam-bsfilter-args
+                (list "--list-spam")
+                (if elmo-spam-bsfilter-database-directory
+                    (list "--homedir" elmo-spam-bsfilter-database-directory))
+                targets))
+      (when (and temp-file (file-exists-p temp-file))
+       (with-current-buffer (get-buffer-create "*Debug ELMO Bsfilter*")
+         (goto-char (point-max))
+         (insert-file-contents temp-file))
+       (delete-file temp-file)))))
 
 (luna-define-method elmo-spam-list-spam-messages :around
   ((processor elsp-bsfilter) folder &optional numbers)