* Possible SpamAssassin node info documentation error.
@ 2003-10-15 19:31 Rob Browning
2003-10-15 19:42 ` Rob Browning
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Rob Browning @ 2003-10-15 19:31 UTC (permalink / 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Possible SpamAssassin node info documentation error.
2003-10-15 19:31 Possible SpamAssassin node info documentation error Rob Browning
@ 2003-10-15 19:42 ` Rob Browning
2003-10-16 14:52 ` Ted Zlatanov
2003-10-16 13:42 ` Lars Magne Ingebrigtsen
2003-10-16 14:50 ` Ted Zlatanov
2 siblings, 1 reply; 7+ messages in thread
From: Rob Browning @ 2003-10-15 19:42 UTC (permalink / raw)
Rob Browning <rlb@defaultvalue.org> writes:
> 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
Oops.
NOTE: don't use that function -- that widen is probably *wrong* --
seemed to cause gnus to grab the whole mailbox in one message.
I'm guessing you want something that just widens to include the body
of the current message, whatever that would be.
--
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Possible SpamAssassin node info documentation error.
2003-10-15 19:31 Possible SpamAssassin node info documentation error Rob Browning
2003-10-15 19:42 ` Rob Browning
@ 2003-10-16 13:42 ` Lars Magne Ingebrigtsen
2003-12-03 23:03 ` Kevin Ryde
2003-10-16 14:50 ` Ted Zlatanov
2 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-10-16 13:42 UTC (permalink / raw)
Rob Browning <rlb@defaultvalue.org> writes:
> 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*"))))
In CVS Gnus, it reads:
(defun kevin-spamassassin ()
(save-excursion
(widen)
(if (eq 1 (call-process-region (point-min) (point-max)
"spamc" nil nil nil "-c"))
"spam")))
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Possible SpamAssassin node info documentation error.
2003-10-15 19:31 Possible SpamAssassin node info documentation error Rob Browning
2003-10-15 19:42 ` Rob Browning
2003-10-16 13:42 ` Lars Magne Ingebrigtsen
@ 2003-10-16 14:50 ` Ted Zlatanov
2 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2003-10-16 14:50 UTC (permalink / raw)
Cc: ding
On Wed, 15 Oct 2003, rlb@defaultvalue.org wrote:
> 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.
This was already fixed in the CVS manual.
Thanks
Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Possible SpamAssassin node info documentation error.
2003-10-15 19:42 ` Rob Browning
@ 2003-10-16 14:52 ` Ted Zlatanov
0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2003-10-16 14:52 UTC (permalink / raw)
Cc: ding
On Wed, 15 Oct 2003, rlb@defaultvalue.org wrote:
> Rob Browning <rlb@defaultvalue.org> writes:
>
>> 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
>
> Oops.
>
> NOTE: don't use that function -- that widen is probably *wrong* --
> seemed to cause gnus to grab the whole mailbox in one message.
>
> I'm guessing you want something that just widens to include the body
> of the current message, whatever that would be.
(widen) in an incoming message is supposed to just widen to the
message, so this could be a bug. Can you please submit a bug (it will
tell us your mail backend and other useful information)? Make sure
you look at the example in the CVS manual, not the one in the 5.10.2
manual.
Thanks
Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Possible SpamAssassin node info documentation error.
2003-10-16 13:42 ` Lars Magne Ingebrigtsen
@ 2003-12-03 23:03 ` Kevin Ryde
2003-12-04 16:32 ` Ted Zlatanov
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Ryde @ 2003-12-03 23:03 UTC (permalink / raw)
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>
> (defun kevin-spamassassin ()
> (save-excursion
> (widen)
Should there be a save-restriction too, or does gnus not care about
that once it gets to the splitting stage?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Possible SpamAssassin node info documentation error.
2003-12-03 23:03 ` Kevin Ryde
@ 2003-12-04 16:32 ` Ted Zlatanov
0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2003-12-04 16:32 UTC (permalink / raw)
Cc: ding
On Thu, 04 Dec 2003, user42@zip.com.au wrote:
> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>>
>> (defun kevin-spamassassin ()
>> (save-excursion
>> (widen)
>
> Should there be a save-restriction too, or does gnus not care about
> that once it gets to the splitting stage?
I added save-restriction in this example and the other one (in Fancy
Mail Splitting). Thanks!
Ted
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-12-04 16:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 19:31 Possible SpamAssassin node info documentation error Rob Browning
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
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).