Gnus development mailing list
 help / color / mirror / Atom feed
* 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

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).