From 7d9422ddcfda28c198323f0f90a240af003d8400 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sun, 27 Aug 2006 14:30:46 +0000 Subject: [PATCH] (elsp-bsfilter-list-spam-files): Fix the argument BUFFER of `call-process'. --- elmo/ChangeLog | 5 +++++ elmo/elsp-bsfilter.el | 39 +++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index f9b9951..ce6df16 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2006-08-27 Hiroya Murata + + * elsp-bsfilter.el (elsp-bsfilter-list-spam-files): Fix the + argument BUFFER of `call-process'. + 2006-08-27 Yoichi NAKAYAMA * elsp-bsfilter.el (elsp-bsfilter-call-bsfilter): Remove nil from diff --git a/elmo/elsp-bsfilter.el b/elmo/elsp-bsfilter.el index ab7f53d..9ba26af 100644 --- a/elmo/elsp-bsfilter.el +++ b/elmo/elsp-bsfilter.el @@ -108,22 +108,29 @@ (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) -- 1.7.10.4