Gnus development mailing list
 help / color / mirror / Atom feed
From: Alexander Kotelnikov <sacha@myxomop.com>
Subject: Piping an article, imap numbering
Date: Mon, 05 Sep 2005 16:24:59 +0400	[thread overview]
Message-ID: <878xyb8zxg.fsf@myxomop.com> (raw)

Hello.

I have a mailbox for mail which was not splitted anywhere and probably
(and almost always) is spam. So once a certain period I want all this
mail to be piped to "sa-learn --spam", marked as read and moved to a
spam mailbox (I do not delete them in case of mistake). I wrote a
function that helps me but I believe it is not completely elegant:

(defun my-gnus-sa-learn-and-move(&optional n)
  ""
  (interactive "p")
  (mapc
   (lambda (n)
     (gnus-summary-goto-article n)
     (gnus-summary-show-article t)
     (gnus-summary-save-in-pipe "sa-learn --spam")
     (gnus-summary-move-article 1 "nnimap+myxomop:INBOX.spam")
     )
   (gnus-summary-work-articles n)
   )
  (delete-other-windows)
)
(add-hook 'gnus-summary-mode-hook
          '(lambda ()
             (define-key gnus-summary-mode-map "\C-cs"
               'my-gnus-sa-learn-and-move)))

What I do not like here:
1. I found 4 functions for piping messages:
   gnus-summary-save-in-pipe, (defined in gnus-art.el!)
   gnus-summary-pipe-output,
   gnus-summary-pipe-message,
   message-pipe-buffer-body
isn't it too much and too redundant?
2. None ot these functions accepts article number as an argument, so
one need to open an article first and then process it.

The other question is if I have an imap mailbox with several messages,
read them and delete, say, the last one, then after one more is
received *Group* shows '2' for corresponding group (and it is clear
why), but can I ask gnus to be more intelligent here?
--
Alexander Kotelnikov
Saint-Petersburg, Russia




             reply	other threads:[~2005-09-05 12:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-05 12:24 Alexander Kotelnikov [this message]
2005-09-05 12:35 ` nntps still hangs | " Alexander Kotelnikov
2005-09-05 13:43 ` Reiner Steib
2005-09-06 11:50   ` Alexander Kotelnikov

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=878xyb8zxg.fsf@myxomop.com \
    --to=sacha@myxomop.com \
    /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).