[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On the best practices
From: |
Reiner Steib |
Subject: |
Re: On the best practices |
Date: |
Thu, 06 May 2004 20:46:36 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) |
On Thu, May 06 2004, Xavier Maillard wrote:
> What is the best practice to "move" ticked and permanent articles
> into special groups where they could stay forever without
> interfering with other frequently visited groups ?
> My guess is that I could create groups based on certain topics
> (ie. a group dedicated to emacs related articles, etc...) and save
> them. The problem is I don't really know how to do this since I have
> never done this before ;)
It might be not `best practice', but here is what I use.
`rs-gnus-summary-save-to-archive' saves interesting articles from
`gnu.emacs.gnus' in "nnml+archive:gnu.emacs.gnus".
Adding (setq gnus-default-article-saver
'rs-gnus-summary-save-to-archive) allow to save articles with `o'.
--8<---------------cut here---------------start------------->8---
;; This allows you to save articles with `o':
;; (setq gnus-default-article-saver 'rs-gnus-summary-save-to-archive)
;; Alternatively you can add a different keybinding, e.g.:
;; (add-hook
;; 'gnus-summary-mode-hook
;; '(lambda ()
;; (local-set-key (kbd "%") 'rs-gnus-summary-save-to-archive)))
(require 'gnus-sum)
(defvar rs-gnus-archive-prefix "nnml+archive:"
"Name of my prefered archive server.")
(defvar rs-gnus-query-archive-regex "drafts"
"If value of `gnus-newsgroup-name' matches this regexp, query before
archiving the article.")
;;;###autoload
(defun rs-gnus-summary-save-to-archive (&optional n)
"Copy article(s) to an archive group."
(interactive "P")
;; Suggested by Josh Huber in <87d6v3b0io.fsf@alum.wpi.edu>
;; Added process/prefix stuff
(let ((group-name (if (string-match ":" gnus-newsgroup-name)
(substring gnus-newsgroup-name (match-end 0))
gnus-newsgroup-name))
(orig-mark (gnus-summary-article-mark n))
archive-group)
(if (and (string-match gnus-newsgroup-name rs-gnus-query-archive-regex)
(not (y-or-n-p
(concat "Archive article to group `"
archive-group "? "))))
(gnus-message 5 "Aborted.")
(progn
(setq archive-group (concat rs-gnus-archive-prefix group-name))
(gnus-summary-mark-article n gnus-ancient-mark t)
(gnus-summary-copy-article n archive-group)
(gnus-summary-mark-article n orig-mark t)
;; for not fooling `rs-gnus-notify-mail':
(when (fboundp 'rs-gnus-notify-no-new-mail)
(rs-gnus-notify-no-new-mail))))))
--8<---------------cut here---------------end--------------->8---
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/