* nnmail.el (nnmail-spool-hook): new hook
[gnus] / 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-sum)
33 (require 'nnmail)
34
35 ;; (defcustom gnus-summary-article-spool-hook nil
36 ;;   "*A hook called after an article is spooled."
37 ;;   :group 'gnus-summary
38 ;;   :type 'hook)
39
40 (defun regtest (action id from &optional to method)
41   (message "Registry: article %s %s from %s to %s"
42            id
43            (if method "respooling" "going")
44            (gnus-group-guess-full-name from)
45            (if to (gnus-group-guess-full-name to) "the Bit Bucket in the sky")))
46
47 (defun regtest-nnmail (id group)
48   (message "Registry: article %s spooled to %s"
49            id
50            (gnus-group-guess-full-name group)))
51
52 (add-hook 'gnus-summary-article-move-hook 'regtest) ; also does copy, respool, and crosspost
53 (add-hook 'gnus-summary-article-delete-hook 'regtest)
54 (add-hook 'gnus-summary-article-expire-hook 'regtest)
55 (add-hook 'nnmail-spool-hook 'regtest-nnmail)
56
57 ;; TODO:
58
59 (provide 'gnus-registry)
60
61 ;;; gnus-registry.el ends here