annotate lisp/gnus/nndir.el @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents 0d2f883870bc
children 360340f9fd5f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; nndir.el --- single directory newsgroup access for Gnus
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2 ;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (require 'nnheader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (require 'nnmh)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (require 'nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (require 'nnoo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (nnoo-declare nndir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 nnml nnmh)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defvoo nndir-directory nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "Where nndir will look for groups."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 nnml-current-directory nnmh-current-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defvoo nndir-nov-is-evil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 "*Non-nil means that nndir will never retrieve NOV headers."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 nnml-nov-is-evil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defvoo nndir-current-group "" nil nnml-current-group nnmh-current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defvoo nndir-top-directory nil nil nnml-directory nnmh-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (defvoo nndir-get-new-mail nil nil nnml-get-new-mail nnmh-get-new-mail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (defvoo nndir-status-string "" nil nnmh-status-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (defconst nndir-version "nndir 1.0")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;; Interface functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (nnoo-define-basics nndir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (deffoo nndir-open-server (server &optional defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (setq nndir-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (or (cadr (assq 'nndir-directory defs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 server))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (unless (assq 'nndir-directory defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (push `(nndir-directory ,server) defs))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 32
diff changeset
66 ;(when (equal server "")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 32
diff changeset
67 ; (setq server (cadr (assq 'nndir-directory defs))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (push `(nndir-current-group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ,(file-name-nondirectory (directory-file-name nndir-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (push `(nndir-top-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ,(file-name-directory (directory-file-name nndir-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (nnoo-change-server 'nndir server defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (let (err)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 32
diff changeset
76 (cond
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ((not (condition-case arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (file-exists-p nndir-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (ftp-error (setq err (format "%s" arg)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (nndir-close-server)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 32
diff changeset
81 (nnheader-report
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 'nndir (or err "No such file or directory: %s" nndir-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ((not (file-directory-p (file-truename nndir-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (nndir-close-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (nnheader-report 'nndir "Not a directory: %s" nndir-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (nnheader-report 'nndir "Opened server %s using directory %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 server nndir-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (nnoo-map-functions nndir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (nnml-retrieve-headers 0 nndir-current-group 0 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (nnmh-request-article 0 nndir-current-group 0 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (nnmh-request-group nndir-current-group 0 0)
104
cf808b4c4290 Import from CVS: tag r20-1b4
cvs
parents: 98
diff changeset
95 (nnml-close-group nndir-current-group 0)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (nnmh-request-list (nnoo-current-server 'nndir) nndir-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (nnmh-request-newsgroups (nnoo-current-server 'nndir) nndir-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (provide 'nndir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;;; nndir.el ends here