[spambayes-dev] Proposal for Emacs script to save spam-nonspam messages for training purposes

Paul Huygen paul.huygen at huygen.nl
Sun Aug 24 16:34:24 EDT 2003


While looking on the web for code to optimize emacs's VM for handling
spam, I found (in url http://mail.python.org/pipermail/spambayes-checkins/2003-May/001291.html) your script:

> (defun copy-to-spam ()
>   (interactive)
>   (vm-save-message (expand-file-name "~/tmp/newspam"))
>   (vm-undelete-message 1))
> (defun copy-to-nonspam ()
>   (interactive)
>   (vm-save-message (expand-file-name "~/tmp/newham"))
>   (vm-undelete-message 1))
> (define-key vm-mode-map "ls" 'copy-to-spam)
> (define-key vm-summary-mode-map "ls" 'copy-to-spam)
> (define-key vm-mode-map "lh" 'copy-to-nonspam)
> (define-key vm-summary-mode-map "lh" 'copy-to-nonspam)

Thank you for this script. However, it did not run properly in my
case. The function "copy-to-spam" saves the current message into
"~/tmp/newspam", then marks it for deletion, jumps to the next message and
undeletes that message. In my case, the following modification of e.g.
copy-to-spam seems to work:

(defun copy-to-spam ()
  (let ((vm-move-after-deleting nil))
       (vm-save-message (expand-file-name "~/mail/mboxes/newspam")))
  (let ((vm-move-after-undeleting t)) (vm-undelete-message 1)))

Best regards,

Paul Huygen

More information about the spambayes-dev mailing list