aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLudovic Courtes2010-10-02 10:35:45 +0000
committerKatsumi Yamaoka2010-10-02 10:35:45 +0000
commitaffb61b481035b41c7c37b1acb2267a610605aa2 (patch)
tree7925b01115a8470b90c388a0e7712f27bad8e5c4
parent367f7f81d1923c6418c4d5beb04144d3dbef476a (diff)
downloademacs-affb61b481035b41c7c37b1acb2267a610605aa2.tar.gz
emacs-affb61b481035b41c7c37b1acb2267a610605aa2.zip
Add lisp/gnus/nnregistry.el.
-rw-r--r--lisp/gnus/nnregistry.el65
1 files changed, 65 insertions, 0 deletions
diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el
new file mode 100644
index 00000000000..b2d80503479
--- /dev/null
+++ b/lisp/gnus/nnregistry.el
@@ -0,0 +1,65 @@
1;;; nnregistry.el --- access to articles via Gnus' message-id registry
2;;; -*- coding: utf-8 -*-
3
4;; Copyright (C) 2010 Free Software Foundation, Inc.
5
6;; Authors: Ludovic Courtès <ludo@gnu.org>
7;; Keywords: news, mail
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
23
24;;; Commentary:
25
26;; This file provides the `nnregistry' Gnus back-end. It can be used
27;; in `gnus-refer-article-method' to quickly search for a message by
28;; id, regardless of the back-end that stores it.
29
30;;; Code:
31
32(require 'nnoo)
33(require 'gnus-registry)
34(require 'gnus-int)
35
36(nnoo-declare nnregistry)
37
38(deffoo nnregistry-server-opened (server)
39 (eq gnus-registry-install t))
40
41(deffoo nnregistry-close-server (server)
42 t)
43
44(deffoo nnregistry-status-message (server)
45 nil)
46
47(deffoo nnregistry-open-server (server &optional defs)
48 (eq gnus-registry-install t))
49
50(defvar nnregistry-within-nnregistry nil)
51
52(deffoo nnregistry-request-article (id &optional group server buffer)
53 (and (not nnregistry-within-nnregistry)
54 (let* ((nnregistry-within-nnregistry t)
55 (group (gnus-registry-fetch-group id))
56 (gnus-override-method nil))
57 (message "nnregistry: requesting article `%s' in group `%s'"
58 id group)
59 (and group
60 (gnus-check-group group)
61 (gnus-request-article id group buffer)))))
62
63(provide 'nnregistry)
64
65;;; nnregistry.el ends here