info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnus-summary-save-in-pipe & article editing


From: Raphaël Berbain
Subject: gnus-summary-save-in-pipe & article editing
Date: Wed, 13 Oct 2004 17:11:20 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Hi,

I recently switched to Monkeyplexer (a crm114-based mail
classification tool).  It now acts as both my procmail and
spam-killer.  It needs training & error corrections to work.

So I wrote this function below in order to train misclassified
messages.

,----
| (defun rgb/gnus-monkeyplex-move (&optional n)
|   "Move articles, training monkeyplexer at the same time."
|   (interactive "P")
|   (let* ((articles (gnus-summary-work-articles n))
|          (backend  "nnmaildir+nol:")
|          (group    (gnus-read-move-group-name "Monkeyplex" "inbox" articles 
backend))
|          (pipe     (format "monkeyplexer -u $HOME/.monkeyplexer --learn=.%s"
|                            (substring group (length backend)))))
|     (save-excursion
|       (dolist (article articles)
|         (gnus-summary-goto-subject article)
|         (gnus-summary-show-raw-article)
|         (gnus-summary-save-in-pipe pipe))
|       (gnus-summary-move-article nil group)))
|   (gnus-summary-expand-window))
`----

It works ok, but there are still a couple of things bothering me:

- Is there a way to find the current server, instead of hardcoding it
  in the function ?

- Currently, this trains Monkeyplexer, then moves the article to the
  target group.  However, it would be really nice if I could _replace_
  the original article with the pipe output (basically, the goal is to
  update the X-Monkeyplexer-* headers).  Is there a way to do that ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]