[mew-dist 25204] mew with bsfilter (Re: mark)

Eisaku YAMAGUCHI eisaku at example.com
2004年 8月 26日 (木) 03:16:26 JST


山口です.

From: Eisaku YAMAGUCHI <eisaku at example.com>
Subject: [mew-dist 25203] mark
Date: Thu, 26 Aug 2004 02:39:49 +0900 (JST)
Message-ID: <20040826.023949.125124005.eisaku at example.com>
> 
> 山口です.
> 
> p.s.
> 今回の変更でbsfilterでマーク付きを一括処理しようとすると
> | Symbol's value as variable is void: mew-mark-multi
> と言われるようになってしまったのが悲しい.

mew-summary-cmd-msgsを参考に,bsfilter.elをquick hackしてみました.

originalに近い動作をさせると,spam判定前後でマーク(*)の変化がなくなり
ます.
spam判定後と判るよう,* -> $ と変化させてみましたが,n,p でメッセージ
を移動するためには,一度msかU$しないといけません.
マークを無くすと,spam判定したものか,判定前かの区別がsummaryから
読み取れなくなります.

悩むところですね.

-- EY
-------------- next part --------------
;; $Id: mew.el,v 1.1 2004/02/28 15:24:09 nabeken Exp $
(define-key mew-summary-mode-map "bm" 'mew-bsfilter-mark)
(define-key mew-summary-mode-map "bM" 'mew-bsfilter-mark-multi)
(define-key mew-summary-mode-map "bs" 'mew-bsfilter-spam)
(define-key mew-summary-mode-map "bS" 'mew-bsfilter-spam-multi)
(define-key mew-summary-mode-map "bc" 'mew-bsfilter-clean)
(define-key mew-summary-mode-map "bC" 'mew-bsfilter-clean-multi)

(setq mew-refile-ctrl-multi nil)

(setq mew-field-spec
      (reverse (append (list (car (reverse mew-field-spec)))
		       '(("^X-Spam-Probability:$" t)
			 ("^X-Spam-Flag:$" t))
		       (cdr (reverse mew-field-spec)))))

(defun mew-bsfilter-cmd-msg (command)
  "Executing an external command specifying this message as an
argument."
  (interactive)
  (mew-summary-goto-message)
  (mew-summary-msg
   (let* ((fld (mew-summary-folder-name))
	  (msg (mew-summary-message-number))
	  (file (mew-expand-folder fld msg)))
     (while (not (mew-which-exec command))
       (setq command (read-string "Command: ")))
     (message "Executing %s for %s..." command msg)
     (call-process command nil nil nil file)
     (message "Executing %s for %s...done" command msg))))

(defun mew-bsfilter-cmd-msgs (command)
  "Executing an external command specifying messages
marked with '*' as arguments."
  (interactive)
  (mew-summary-multi-msgs
   (let ()
     (while (not (mew-which-exec command))
       (setq command (read-string "Command: ")))
     (message "Executing %s ..." command)
     (apply 'call-process command nil nil nil FILES)
     (message "Executing %s ...done" command))))


(defun mew-bsfilter-mark ()
  "mew-bsfilter-mark"
  (interactive)
  (mew-bsfilter-cmd-msg "bs_mark")
  (mew-summary-escape))

(defun mew-bsfilter-mark-multi ()
  "mew-bsfilter-mark-multi"
  (interactive)
  (mew-bsfilter-cmd-msgs "bs_mark")
  (mew-summary-mark-escape))

(defun mew-bsfilter-spam ()
  "mew-bsfilter-spam"
  (interactive)
  (mew-bsfilter-cmd-msg "bs_spam")
  (mew-summary-escape))

(defun mew-bsfilter-spam-multi ()
  "mew-bsfilter-spam-multi"
  (interactive)
  (mew-bsfilter-cmd-msgs "bs_spam")
  (mew-summary-mark-escape))

(defun mew-bsfilter-clean ()
  "mew-bsfilter-clean"
  (interactive)
  (mew-bsfilter-cmd-msg "bs_clean")
  (mew-summary-escape))

(defun mew-bsfilter-clean-multi ()
  "mew-bsfilter-clean-multi"
  (interactive)
  (mew-bsfilter-cmd-msgs "bs_clean")
  (mew-summary-mark-escape))


Mew-dist メーリングリストの案内