From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60899 Path: news.gmane.org!not-for-mail From: Alexander Kotelnikov Newsgroups: gmane.emacs.gnus.general Subject: Piping an article, imap numbering Date: Mon, 05 Sep 2005 16:24:59 +0400 Organization: Global disintoxication Message-ID: <878xyb8zxg.fsf@myxomop.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1125924199 31467 80.91.229.2 (5 Sep 2005 12:43:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Sep 2005 12:43:19 +0000 (UTC) Original-X-From: ding-owner+m9430=ding+2daccount=gmane.org@lists.math.uh.edu Mon Sep 05 14:43:17 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ECGHp-0001KM-Rv for ding-account@gmane.org; Mon, 05 Sep 2005 14:41:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1ECGHo-0004CX-01 for ding-account@gmane.org; Mon, 05 Sep 2005 07:41:20 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1ECG9U-0004CG-00 for ding@lists.math.uh.edu; Mon, 05 Sep 2005 07:32:44 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1ECG9S-000782-4L for ding@lists.math.uh.edu; Mon, 05 Sep 2005 07:32:43 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ECG9Q-00029G-00 for ; Mon, 05 Sep 2005 14:32:40 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ECG7v-0005WL-QQ for ding@gnus.org; Mon, 05 Sep 2005 14:31:08 +0200 Original-Received: from 81.211.124.120.adsl-spb.net.rol.ru ([81.211.124.120]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Sep 2005 14:31:07 +0200 Original-Received: from sacha by 81.211.124.120.adsl-spb.net.rol.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Sep 2005 14:31:07 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 44 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 81.211.124.120.adsl-spb.net.rol.ru Mail-Copies-To: never User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:Hcl6beCeGXSoR4G5OpKtLekgVME= X-Spam-Score: -1.3 (-) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60899 Archived-At: 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