79b4ad50fbf0250b02c66d2625acacb6052c9c12
[elisp/gnus.git-] / lisp / gnus-registry.el
1 ;;; gnus-registry.el --- article registry for Gnus
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 ;;        Free Software Foundation, Inc.
4
5 ;; Author: Ted Zlatanov <tzz@lifelogs.com>
6 ;; Keywords: news
7
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (eval-when-compile (require 'cl))
30
31 (require 'gnus)
32 (require 'gnus-int)
33 (require 'gnus-sum)
34 (require 'nnmail)
35
36 ;; (defcustom gnus-summary-article-spool-hook nil
37 ;;   "*A hook called after an article is spooled."
38 ;;   :group 'gnus-summary
39 ;;   :type 'hook)
40
41 (defun regtest (action id from &optional to method)
42   (message "Registry: article %s %s from %s to %s"
43            id
44            (if method "respooling" "going")
45            (gnus-group-guess-full-name from)
46            (if to (gnus-group-guess-full-name to) "the Bit Bucket in the sky")))
47
48 (defun regtest-nnmail (id group)
49   (message "Registry: article %s spooled to %s"
50            id
51            (gnus-group-prefixed-name group gnus-internal-registry-spool-current-method t)))
52
53 ;;(add-hook 'gnus-summary-article-move-hook 'regtest) ; also does copy, respool, and crosspost
54 ;;(add-hook 'gnus-summary-article-delete-hook 'regtest)
55 ;;(add-hook 'gnus-summary-article-expire-hook 'regtest)
56 (add-hook 'nnmail-spool-hook 'regtest-nnmail)
57
58 ;; TODO:
59
60 (provide 'gnus-registry)
61
62 ;;; gnus-registry.el ends here