Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Frank Schmitt <usereplyto2004@Frank-Schmitt.net>
Subject: Re: How to write function to operate on marked articles?
Date: Mon, 15 Mar 2004 23:47:32 +0100	[thread overview]
Message-ID: <m38yi1vibf.fsf@fed1.frank-schmitt.net> (raw)
In-Reply-To: <hddd67el2m3.fsf@bacchus.pvv.ntnu.no>

Svend Tollak Munkejord <stm+direct_reply@bacchus.pvv.org> writes:

> I have the following function to tell Spamassassin that a message is spam:
>
> (defun stm-spamassassin-spam ()
>   (interactive)
>   (gnus-summary-show-raw-article)
>   (gnus-summary-save-in-pipe "sa-learn --spam");
>   (gnus-summary-move-article 1 "nnmaildir:boss" nil nil))
> ; "boss" is Norwegian meaning "rubbish".
>
> It only works on the current article. Is there a way I can modify this
> function to operate on all marked articles in the Summary buffer, one at a
> time?

Yes, you can use the function gnus-summary-work-articles to get a list
of all process-marked articles. Have a look in
gnus-summary-move-article for an example. Remember to wrap the code in
(eval-after-load 'gnus-sum (...))

-- 
Did you ever realize how much text fits in eighty columns? If you now consider
that a signature usually consists of up to four lines, this gives you enough
space to spread a tremendous amount of information with your messages. So seize
this opportunity and don't waste your signature with bullshit nobody will read.


  reply	other threads:[~2004-03-15 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 12:24 Svend Tollak Munkejord
2004-03-15 22:47 ` Frank Schmitt [this message]
     [not found]   ` <hddsmg8rjhu.fsf@bacchus.pvv.ntnu.no>
     [not found]     ` <m38yi0egce.fsf@fed1.frank-schmitt.net>
2004-03-17  7:45       ` Svend Tollak Munkejord

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=m38yi1vibf.fsf@fed1.frank-schmitt.net \
    --to=usereplyto2004@frank-schmitt.net \
    --cc=replies@Frank-Schmitt.net \
    /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).