From: Rob Browning <rlb@defaultvalue.org>
Subject: Possible SpamAssassin node info documentation error.
Date: Wed, 15 Oct 2003 14:31:59 -0500 [thread overview]
Message-ID: <87ptgy5mc0.fsf@raven.i.defaultvalue.org> (raw)
In the current info pages (for 5.10.2), in the "SpamAssassin, Vipul's
Razor, DCC, etc" node, it suggests:
(defun kevin-spamassassin ()
(save-excursion
(let ((buf (or (get-buffer " *nnmail incoming*")
(get-buffer " *nnml move*"))))
(if (not buf)
(progn (message "Oops, cannot find message buffer") nil)
(set-buffer buf)
(if (eq 1 (call-process-region (point-min) (point-max)
"spamc" nil nil nil "-c"))
"spam")))))
but my experience is that this doesn't actually work because the
buffer (at least during a "B q") is narrowed to the headers. For this
to work as advertized, you need to add a (widen) after setting the
buffer, perhaps like this (also happen to be using spamassassin in
this example rather than spamc):
(defun kevin-spamassassin ()
(save-excursion
(let ((buf (or (get-buffer " *nnmail incoming*")
(get-buffer " *nnml move*")
;; probably just respooling or tracing...
(set-buffer gnus-original-article-buffer))))
(if (not buf)
(progn (message "Oops, cannot find message buffer") nil)
(set-buffer buf)
(widen)
(if (zerop (call-process-region (point-min) (point-max)
"spamassassin" nil nil nil "-e"))
nil
"spam")))))
Hope this helps.
--
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
next reply other threads:[~2003-10-15 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-15 19:31 Rob Browning [this message]
2003-10-15 19:42 ` Rob Browning
2003-10-16 14:52 ` Ted Zlatanov
2003-10-16 13:42 ` Lars Magne Ingebrigtsen
2003-12-03 23:03 ` Kevin Ryde
2003-12-04 16:32 ` Ted Zlatanov
2003-10-16 14:50 ` Ted Zlatanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ptgy5mc0.fsf@raven.i.defaultvalue.org \
--to=rlb@defaultvalue.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).