[Top][All Lists]

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

Copy and expire

From: Julien Cubizolles
Subject: Copy and expire
Date: Fri, 02 Aug 2013 11:24:44 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

I asked a while ago about a function to copy marked articles to another
group and then expire them in the current group. Here is it what I came
up with, for those interested.

--8<---------------cut here---------------start------------->8---
(defun jc-gnus-summary-copy-and-expire-article (&optional n to-newsgroup 
  "Copy the current article to some other group and mark it as expirable.
If TO-NEWSGROUP is string, do not prompt for a newsgroup to copy to.
When called interactively, if TO-NEWSGROUP is nil, use the value of
the variable `gnus-move-split-methods' for finding a default target."
  (interactive "P")
  (let ((articles (gnus-summary-work-articles n))
    (gnus-summary-move-article n to-newsgroup select-method 'copy)
      (while articles
        (gnus-summary-goto-subject (setq article (pop articles)))
        (let (gnus-newsgroup-processable)
          (command-execute 'gnus-summary-mark-as-expirable))
        (gnus-summary-remove-process-mark article)))
--8<---------------cut here---------------end--------------->8---

reply via email to

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