Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Extending the Gnus pyzor example
@ 2010-12-19 16:05 Christopher Culver
  2011-01-02  7:54 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Culver @ 2010-12-19 16:05 UTC (permalink / raw)
  To: info-gnus-english

In the Gnus manual, there is a helpful example of how to report spam
using Pyzor:

(defun my-gnus-raze-spam ()
       "Submit SPAM to Vipul's Razor, then mark it as expirable."
       (interactive)
       (gnus-summary-save-in-pipe "razor-report -f -d" t)
       (gnus-summary-mark-as-expirable 1))

Now, I'd like to change this so that it first moves mail to another
group ("nnml:spam"), and *then* marks it expirable. But once mail has
been moved to another group, how can I access it to mark it as
expirable?

If I try setting it as expirable with gnus-summary-mark-as-expirable
first and then moving it, I get unintended results. The move function
actually ends up moving the next e-mail in the group since setting mail
as expirable automatically selects the next message.

(I have a cron job that runs Spamassassin's Bayesian trainer on my inbox
as ham and the nnml:spam group as spam, that's why I cannot leave spam
messages within my inbox.)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Extending the Gnus pyzor example
  2010-12-19 16:05 Extending the Gnus pyzor example Christopher Culver
@ 2011-01-02  7:54 ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-01-02  7:54 UTC (permalink / raw)
  To: info-gnus-english

Christopher Culver <crculver@christopherculver.com> writes:

> If I try setting it as expirable with gnus-summary-mark-as-expirable
> first and then moving it, I get unintended results. The move function
> actually ends up moving the next e-mail in the group since setting mail
> as expirable automatically selects the next message.

If you wrap it in (save-excursion ...), then point won't move.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-02  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-19 16:05 Extending the Gnus pyzor example Christopher Culver
2011-01-02  7:54 ` Lars Magne Ingebrigtsen

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