annotate lisp/gnus/nnml.el @ 26:441bb1e64a06 r19-15b96

Import from CVS: tag r19-15b96
author cvs
date Mon, 13 Aug 2007 08:51:32 +0200
parents 4103f0995bd7
children 1917ad0d78d7
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 ;;; nnml.el --- mail spool access for Gnus
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
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 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: news, mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; Based on nnspool.el by Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; For an overview of what the interface functions do, please see the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; Gnus sources.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (require 'nnheader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (require 'nnmail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (require 'nnoo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (require 'cl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (nnoo-declare nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defvoo nnml-directory message-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 "Mail spool directory.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (defvoo nnml-active-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (concat (file-name-as-directory nnml-directory) "active")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 "Mail active file.")
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 nnml-newsgroups-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (concat (file-name-as-directory nnml-directory) "newsgroups")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Mail newsgroups description file.")
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 nnml-get-new-mail t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 "If non-nil, nnml will check the incoming mail file and split the mail.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (defvoo nnml-nov-is-evil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 "If non-nil, Gnus will never generate and use nov databases for mail groups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Using nov databases will speed up header fetching considerably.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
57 This variable shouldn't be flipped much. If you have, for some reason,
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 set this to t, and want to set it to nil again, you should always run
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
59 the `nnml-generate-nov-databases' command. The function will go
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 through all nnml directories and generate nov databases for them
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
61 all. This may very well take some time.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (defvoo nnml-prepare-save-mail-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "Hook run narrowed to an article before saving.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (defvoo nnml-inhibit-expiry nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 "If non-nil, inhibit expiry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (defconst nnml-version "nnml 1.0"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 "nnml version.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defvoo nnml-nov-file-name ".overview")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (defvoo nnml-current-directory nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defvoo nnml-current-group nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defvoo nnml-status-string "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (defvoo nnml-nov-buffer-alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (defvoo nnml-group-alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defvoo nnml-active-timestamp nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defvoo nnml-article-file-alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (defvoo nnml-generate-active-function 'nnml-generate-active-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;;; Interface functions.
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-define-basics nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
93 (deffoo nnml-retrieve-headers (sequence &optional group server fetch-old)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
94 (when (nnml-possibly-change-directory group server)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
95 (save-excursion
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
96 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
97 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
98 (let ((file nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
99 (number (length sequence))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
100 (count 0)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
101 beg article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
102 (if (stringp (car sequence))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
103 'headers
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
104 (if (nnml-retrieve-headers-with-nov sequence fetch-old)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
105 'nov
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
106 (while sequence
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
107 (setq article (car sequence))
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
108 (setq file (nnml-article-to-file article))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
109 (when (and (file-exists-p file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
110 (not (file-directory-p file)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
111 (insert (format "221 %d Article retrieved.\n" article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
112 (setq beg (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
113 (nnheader-insert-head file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
114 (goto-char beg)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
115 (if (search-forward "\n\n" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
116 (forward-char -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
117 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
118 (insert "\n\n"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
119 (insert ".\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
120 (delete-region (point) (point-max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
121 (setq sequence (cdr sequence))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
122 (setq count (1+ count))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
123 (and (numberp nnmail-large-newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
124 (> number nnmail-large-newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
125 (zerop (% count 20))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
126 (nnheader-message 6 "nnml: Receiving headers... %d%%"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
127 (/ (* count 100) number))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
128
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (and (numberp nnmail-large-newsgroup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (> number nnmail-large-newsgroup)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
131 (nnheader-message 6 "nnml: Receiving headers...done"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
133 (nnheader-fold-continuation-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
134 'headers))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (deffoo nnml-open-server (server &optional defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (nnoo-change-server 'nnml server defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (when (not (file-exists-p nnml-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (make-directory nnml-directory t)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
141 (error)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ((not (file-exists-p nnml-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (nnml-close-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (nnheader-report 'nnml "Couldn't create directory: %s" nnml-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ((not (file-directory-p (file-truename nnml-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (nnml-close-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (nnheader-report 'nnml "Not a directory: %s" nnml-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (nnheader-report 'nnml "Opened server %s using directory %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 server nnml-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
154 (defun nnml-request-regenerate (server)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
155 (nnml-possibly-change-directory nil server)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
156 (nnml-generate-nov-databases)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
157 t)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
158
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
159 (deffoo nnml-request-article (id &optional group server buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
160 (nnml-possibly-change-directory group server)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (let* ((nntp-server-buffer (or buffer nntp-server-buffer))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
162 path gpath group-num)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (if (stringp id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (when (and (setq group-num (nnml-find-group-number id))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
165 (cdr
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
166 (assq (cdr group-num)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
167 (nnheader-article-to-file-alist
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
168 (setq gpath
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
169 (nnmail-group-pathname
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
170 (car group-num)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
171 nnml-directory))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (setq path (concat gpath (int-to-string (cdr group-num)))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
173 (setq path (nnml-article-to-file id)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((not path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (nnheader-report 'nnml "No such article: %s" id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ((not (file-exists-p path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (nnheader-report 'nnml "No such file: %s" path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ((file-directory-p path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (nnheader-report 'nnml "File is a directory: %s" path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ((not (save-excursion (nnmail-find-file path)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (nnheader-report 'nnml "Couldn't read file: %s" path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (nnheader-report 'nnml "Article %s retrieved" id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ;; We return the article number.
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
186 (cons (if group-num (car group-num) group)
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
187 (string-to-int (file-name-nondirectory path)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (deffoo nnml-request-group (group &optional server dont-check)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ((not (nnml-possibly-change-directory group server))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (nnheader-report 'nnml "Invalid group (no such directory)"))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
193 ((not (file-exists-p nnml-current-directory))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
194 (nnheader-report 'nnml "Directory %s does not exist"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
195 nnml-current-directory))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ((not (file-directory-p nnml-current-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (nnheader-report 'nnml "%s is not a directory" nnml-current-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (dont-check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (nnheader-report 'nnml "Group %s selected" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (t
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
202 (nnheader-re-read-dir nnml-current-directory)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (nnmail-activate 'nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (let ((active (nth 1 (assoc group nnml-group-alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (if (not active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (nnheader-report 'nnml "No such group: %s" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (nnheader-report 'nnml "Selected group %s" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (nnheader-insert "211 %d %d %d %s\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (max (1+ (- (cdr active) (car active))) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (car active) (cdr active) group))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (deffoo nnml-request-scan (&optional group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (setq nnml-article-file-alist nil)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
214 (nnml-possibly-change-directory group server)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (nnmail-get-new-mail 'nnml 'nnml-save-nov nnml-directory group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (deffoo nnml-close-group (group &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (setq nnml-article-file-alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
221 (deffoo nnml-request-create-group (group &optional server args)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (nnmail-activate 'nnml)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
223 (unless (assoc group nnml-group-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
224 (let (active)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
225 (push (list group (setq active (cons 1 0)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
226 nnml-group-alist)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
227 (nnml-possibly-create-directory group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
228 (nnml-possibly-change-directory group server)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
229 (let ((articles (nnheader-directory-articles nnml-current-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
230 (when articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
231 (setcar active (apply 'min articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
232 (setcdr active (apply 'max articles))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
233 (nnmail-save-active nnml-group-alist nnml-active-file)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (deffoo nnml-request-list (&optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (nnmail-find-file nnml-active-file)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
239 (setq nnml-group-alist (nnmail-get-active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
240 t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (deffoo nnml-request-newgroups (date &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (nnml-request-list server))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (deffoo nnml-request-list-newsgroups (&optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (nnmail-find-file nnml-newsgroups-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
249 (deffoo nnml-request-expire-articles (articles group
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
250 &optional server force)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
251 (nnml-possibly-change-directory group server)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (let* ((active-articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (nnheader-directory-articles nnml-current-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (is-old t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 article rest mod-time number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (nnmail-activate 'nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (while (and articles is-old)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
259 (when (setq article (nnml-article-to-file (setq number (pop articles))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
260 (when (setq mod-time (nth 5 (file-attributes article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
261 (if (and (nnml-deletable-article-p group number)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
262 (setq is-old
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
263 (nnmail-expired-article-p group mod-time force
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
264 nnml-inhibit-expiry)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
265 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
266 (nnheader-message 5 "Deleting article %s in %s"
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
267 article group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
268 (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
269 (funcall nnmail-delete-file-function article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
270 (file-error
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
271 (push number rest)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
272 (setq active-articles (delq number active-articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
273 (nnml-nov-delete-article group number))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
274 (push number rest)))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
275 (let ((active (nth 1 (assoc group nnml-group-alist))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (when active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (setcar active (or (and active-articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (apply 'min active-articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (1+ (cdr active)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (nnmail-save-active nnml-group-alist nnml-active-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (nnml-save-nov)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (nconc rest articles)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (deffoo nnml-request-move-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (article group server accept-form &optional last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (let ((buf (get-buffer-create " *nnml move*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (nnml-possibly-change-directory group server)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
289 (nnml-update-file-alist)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (nnml-deletable-article-p group article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (nnml-request-article article group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (insert-buffer-substring nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (setq result (eval accept-form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (nnml-possibly-change-directory group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (funcall nnmail-delete-file-function
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
303 (nnml-article-to-file article))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (file-error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (nnml-nov-delete-article group article)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
306 (when last
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
307 (nnml-save-nov)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
308 (nnmail-save-active nnml-group-alist nnml-active-file))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (deffoo nnml-request-accept-article (group &optional server last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (nnml-possibly-change-directory group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (nnmail-check-syntax)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (let (result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (if (stringp group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (nnmail-activate 'nnml)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
318 (setq result (car (nnml-save-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
319 (list (cons group (nnml-active-number group))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (nnmail-save-active nnml-group-alist nnml-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (and last (nnml-save-nov))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (nnmail-activate 'nnml)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
325 (setq result (car (nnml-save-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
326 (nnmail-article-group 'nnml-active-number))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (nnmail-save-active nnml-group-alist nnml-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (and last (nnml-save-nov)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (deffoo nnml-request-replace-article (article group buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (nnml-possibly-change-directory group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (nnml-possibly-create-directory group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (let ((chars (nnmail-insert-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (art (concat (int-to-string article) "\t"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (when (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (progn
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
342 (nnmail-write-region
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (point-min) (point-max)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
344 (or (nnml-article-to-file article)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
345 (concat nnml-current-directory
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
346 (int-to-string article)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 nil (if (nnheader-be-verbose 5) nil 'nomesg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (setq headers (nnml-parse-head chars article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 ;; Replace the NOV line in the NOV file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (set-buffer (nnml-open-nov group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (if (or (looking-at art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (search-forward (concat "\n" art) nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 ;; Delete the old NOV line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (delete-region (progn (beginning-of-line) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (progn (forward-line 1) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 ;; The line isn't here, so we have to find out where
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
361 ;; we should insert it. (This situation should never
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;; occur, but one likes to make sure...)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (while (and (looking-at "[0-9]+\t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (< (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (match-beginning 0) (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (zerop (forward-line 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (nnheader-insert-nov headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (nnml-save-nov)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 t)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (deffoo nnml-request-delete-group (group &optional force server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (nnml-possibly-change-directory group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (when force
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 ;; Delete all articles in GROUP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (let ((articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (directory-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 nnml-current-directory t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (concat nnheader-numerical-short-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 "\\|" (regexp-quote nnml-nov-file-name) "$")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (while articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (setq article (pop articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (when (file-writable-p article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (nnheader-message 5 "Deleting article %s in %s..." article group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (funcall nnmail-delete-file-function article))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 ;; Try to delete the directory itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (delete-directory nnml-current-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (error nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 ;; Remove the group from all structures.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (setq nnml-group-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (delq (assoc group nnml-group-alist) nnml-group-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 nnml-current-group nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 nnml-current-directory nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 ;; Save the active file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (nnmail-save-active nnml-group-alist nnml-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (deffoo nnml-request-rename-group (group new-name &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (nnml-possibly-change-directory group server)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
404 (let ((new-dir (nnmail-group-pathname new-name nnml-directory))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
405 (old-dir (nnmail-group-pathname group nnml-directory)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
406 (when (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
407 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
408 (make-directory new-dir t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
409 t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
410 (error nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
411 ;; We move the articles file by file instead of renaming
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
412 ;; the directory -- there may be subgroups in this group.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
413 ;; One might be more clever, I guess.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
414 (let ((files (nnheader-article-to-file-alist old-dir)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
415 (while files
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
416 (rename-file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
417 (concat old-dir (cdar files))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
418 (concat new-dir (cdar files)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
419 (pop files)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
420 ;; Move .overview file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
421 (let ((overview (concat old-dir nnml-nov-file-name)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
422 (when (file-exists-p overview)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
423 (rename-file overview (concat new-dir nnml-nov-file-name))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
424 (when (<= (length (directory-files old-dir)) 2)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
425 (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
426 (delete-directory old-dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
427 (error nil)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
428 ;; That went ok, so we change the internal structures.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
429 (let ((entry (assoc group nnml-group-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
430 (when entry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
431 (setcar entry new-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
432 (setq nnml-current-directory nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
433 nnml-current-group nil)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
434 ;; Save the new group alist.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
435 (nnmail-save-active nnml-group-alist nnml-active-file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
436 t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
437
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
438 (deffoo nnml-set-status (article name value &optional group server)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
439 (nnml-possibly-change-directory group server)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
440 (let ((file (nnml-article-to-file article)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
441 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
442 ((not (file-exists-p file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
443 (nnheader-report 'nnml "File %s does not exist" file))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
444 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
445 (nnheader-temp-write file
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
446 (nnheader-insert-file-contents file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
447 (nnmail-replace-status name value))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
448 t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 ;;; Internal functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
453 (defun nnml-article-to-file (article)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
454 (nnml-update-file-alist)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
455 (let (file)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
456 (when (setq file (cdr (assq article nnml-article-file-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
457 (concat nnml-current-directory file))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
458
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (defun nnml-deletable-article-p (group article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 "Say whether ARTICLE in GROUP can be deleted."
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
461 (let (path)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
462 (when (setq path (nnml-article-to-file article))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
463 (when (file-writable-p path)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
464 (or (not nnmail-keep-last-article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
465 (not (eq (cdr (nth 1 (assoc group nnml-group-alist)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
466 article)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ;; Find an article number in the current group given the Message-ID.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (defun nnml-find-group-number (id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (set-buffer (get-buffer-create " *nnml id*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (buffer-disable-undo (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (let ((alist nnml-group-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 ;; We want to look through all .overview files, but we want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 ;; start with the one in the current directory. It seems most
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 ;; likely that the article we are looking for is in that group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (if (setq number (nnml-find-id nnml-current-group id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (cons nnml-current-group number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 ;; It wasn't there, so we look through the other groups as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (while (and (not number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (or (string= (caar alist) nnml-current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (setq number (nnml-find-id (caar alist) id)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (or number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (setq alist (cdr alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (and number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (cons (caar alist) number))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (defun nnml-find-id (group id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (let ((nov (concat (nnmail-group-pathname group nnml-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 nnml-nov-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 number found)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (when (file-exists-p nov)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
496 (nnheader-insert-file-contents nov)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
497 (while (and (not found)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (search-forward id nil t)) ; We find the ID.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ;; And the id is in the fourth field.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
500 (if (not (and (search-backward "\t" nil t 4)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
501 (not (search-backward"\t" (gnus-point-at-bol) t))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
502 (forward-line 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
503 (beginning-of-line)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
504 (setq found t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
505 ;; We return the article number.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
506 (setq number
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
507 (condition-case ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
508 (read (current-buffer))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
509 (error nil)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 number)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (defun nnml-retrieve-headers-with-nov (articles &optional fetch-old)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (if (or gnus-nov-is-evil nnml-nov-is-evil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 nil
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
515 (let ((nov (concat nnml-current-directory nnml-nov-file-name)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (when (file-exists-p nov)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (erase-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
520 (nnheader-insert-file-contents nov)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (if (and fetch-old
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (not (numberp fetch-old)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 t ; Don't remove anything.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
524 (nnheader-nov-delete-outside-range
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
525 (if fetch-old (max 1 (- (car articles) fetch-old))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
526 (car articles))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
527 (car (last articles)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 t))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (defun nnml-possibly-change-directory (group &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (when (and server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (not (nnml-server-opened server)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (nnml-open-server server))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
534 (if (not group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
535 t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (let ((pathname (nnmail-group-pathname group nnml-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (when (not (equal pathname nnml-current-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (setq nnml-current-directory pathname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 nnml-current-group group
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
540 nnml-article-file-alist nil))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
541 (file-exists-p nnml-current-directory))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (defun nnml-possibly-create-directory (group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (let (dir dirs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (setq dir (nnmail-group-pathname group nnml-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (while (not (file-directory-p dir))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
547 (push dir dirs)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (setq dir (file-name-directory (directory-file-name dir))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (while dirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (make-directory (directory-file-name (car dirs)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (nnheader-message 5 "Creating mail directory %s" (car dirs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (setq dirs (cdr dirs)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
554 (defun nnml-save-mail (group-art)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 "Called narrowed to an article."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
556 (let (chars headers)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (setq chars (nnmail-insert-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (nnmail-insert-xref group-art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (run-hooks 'nnmail-prepare-save-mail-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (run-hooks 'nnml-prepare-save-mail-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (while (looking-at "From ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (replace-match "X-From-Line: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (forward-line 1))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
565 ;; We save the article in all the groups it belongs in.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (let ((ga group-art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 first)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (while ga
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (nnml-possibly-create-directory (caar ga))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (let ((file (concat (nnmail-group-pathname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (caar ga) nnml-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (int-to-string (cdar ga)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (if first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 ;; It was already saved, so we just make a hard link.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (funcall nnmail-crosspost-link-function first file t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 ;; Save the article.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
577 (nnmail-write-region (point-min) (point-max) file nil
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
578 (if (nnheader-be-verbose 5) nil 'nomesg))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (setq first file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (setq ga (cdr ga))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
581 ;; Generate a nov line for this article. We generate the nov
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 ;; line after saving, because nov generation destroys the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 ;; header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (setq headers (nnml-parse-head chars))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 ;; Output the nov line to all nov databases that should have it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (let ((ga group-art))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (while ga
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (nnml-add-nov (caar ga) (cdar ga) headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (setq ga (cdr ga))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 group-art))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (defun nnml-active-number (group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 "Compute the next article number in GROUP."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (let ((active (cadr (assoc group nnml-group-alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 ;; The group wasn't known to nnml, so we just create an active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ;; entry for it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (unless active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;; Perhaps the active file was corrupt? See whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 ;; there are any articles in this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (nnml-possibly-create-directory group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (nnml-possibly-change-directory group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (unless nnml-article-file-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (setq nnml-article-file-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (nnheader-article-to-file-alist nnml-current-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (lambda (a1 a2) (< (car a1) (car a2))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (setq active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (if nnml-article-file-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (cons (caar nnml-article-file-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (caar (last nnml-article-file-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 (cons 1 0)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
612 (push (list group active) nnml-group-alist))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (setcdr active (1+ (cdr active)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 (while (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (concat (nnmail-group-pathname group nnml-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (int-to-string (cdr active))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (setcdr active (1+ (cdr active))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (cdr active)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 (defun nnml-add-nov (group article headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 "Add a nov line for the GROUP base."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 (set-buffer (nnml-open-nov group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (mail-header-set-number headers article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 (nnheader-insert-nov headers)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (defsubst nnml-header-value ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 (buffer-substring (match-end 0) (progn (end-of-line) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (defun nnml-parse-head (chars &optional number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 "Parse the head of the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (narrow-to-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (1- (or (search-forward "\n\n" nil t) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 ;; Fold continuation lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 (replace-match " " t t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 ;; Remove any tabs; they are too confusing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 (subst-char-in-region (point-min) (point-max) ?\t ? )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (let ((headers (nnheader-parse-head t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (mail-header-set-chars headers chars)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (mail-header-set-number headers number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 headers))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (defun nnml-open-nov (group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (or (cdr (assoc group nnml-nov-buffer-alist))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
652 (let ((buffer (nnheader-find-file-noselect
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (concat (nnmail-group-pathname group nnml-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 nnml-nov-file-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (set-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (buffer-disable-undo (current-buffer)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
658 (push (cons group buffer) nnml-nov-buffer-alist)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (defun nnml-save-nov ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (while nnml-nov-buffer-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (when (buffer-name (cdar nnml-nov-buffer-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (set-buffer (cdar nnml-nov-buffer-alist))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
666 (when (buffer-modified-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
667 (nnmail-write-region 1 (point-max) (buffer-file-name) nil 'nomesg))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (kill-buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (setq nnml-nov-buffer-alist (cdr nnml-nov-buffer-alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (defun nnml-generate-nov-databases ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 "Generate nov databases in all nnml directories."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 ;; Read the active file to make sure we don't re-use articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 ;; numbers in empty groups.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 (nnmail-activate 'nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (nnml-open-server (or (nnoo-current-server 'nnml) ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (setq nnml-directory (expand-file-name nnml-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 ;; Recurse down the directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (nnml-generate-nov-databases-1 nnml-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 ;; Save the active file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (nnmail-save-active nnml-group-alist nnml-active-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
686 (defun nnml-generate-nov-databases-1 (dir &optional seen)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (setq dir (file-name-as-directory dir))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
688 ;; Only scan this sub-tree if we haven't been here yet.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
689 (unless (member (file-truename dir) seen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
690 (push (file-truename dir) seen)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
691 ;; We descend recursively
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
692 (let ((dirs (directory-files dir t nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
693 dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
694 (while (setq dir (pop dirs))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
695 (when (and (not (member (file-name-nondirectory dir) '("." "..")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
696 (file-directory-p dir))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
697 (nnml-generate-nov-databases-1 dir seen))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
698 ;; Do this directory.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
699 (let ((files (sort (nnheader-article-to-file-alist dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
700 (lambda (a b) (< (car a) (car b))))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
701 (when files
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
702 (funcall nnml-generate-active-function dir)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
703 ;; Generate the nov file.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
704 (nnml-generate-nov-file dir files)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (defvar files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 (defun nnml-generate-active-info (dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 ;; Update the active info for this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (let ((group (nnheader-file-to-group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (directory-file-name dir) nnml-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (setq nnml-group-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (delq (assoc group nnml-group-alist) nnml-group-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (push (list group
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
714 (cons (caar files)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (let ((f files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (while (cdr f) (setq f (cdr f)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
717 (caar f))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 nnml-group-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (defun nnml-generate-nov-file (dir files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (let* ((dir (file-name-as-directory dir))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 (nov (concat dir nnml-nov-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (nov-buffer (get-buffer-create " *nov*"))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
724 chars file headers)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 ;; Init the nov buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (set-buffer nov-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (buffer-disable-undo (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 ;; Delete the old NOV file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (when (file-exists-p nov)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (funcall nnmail-delete-file-function nov))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (while files
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
735 (unless (file-directory-p (setq file (concat dir (cdar files))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (erase-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
737 (nnheader-insert-file-contents file)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (narrow-to-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (search-forward "\n\n" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (setq chars (- (point-max) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (max 1 (1- (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (when (and (not (= 0 chars)) ; none of them empty files...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (not (= (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
747 (setq headers (nnml-parse-head chars (caar files)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (set-buffer nov-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (nnheader-insert-nov headers)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (widen))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (setq files (cdr files)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (set-buffer nov-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
756 (nnmail-write-region 1 (point-max) nov nil 'nomesg)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (kill-buffer (current-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (defun nnml-nov-delete-article (group article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 (set-buffer (nnml-open-nov group))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
762 (when (nnheader-find-nov-line article)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
763 (delete-region (point) (progn (forward-line 1) (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
764 (when (bobp)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
765 (let ((active (cadr (assoc group nnml-group-alist)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
766 num)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
767 (when active
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
768 (if (eobp)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
769 (setf (car active) (1+ (cdr active)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
770 (when (and (setq num (ignore-errors (read (current-buffer))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
771 (numberp num))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
772 (setf (car active) num)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
775 (defun nnml-update-file-alist ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
776 (unless nnml-article-file-alist
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
777 (setq nnml-article-file-alist
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
778 (nnheader-article-to-file-alist nnml-current-directory))))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
779
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (provide 'nnml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 ;;; nnml.el ends here