annotate lisp/gnus/nnml.el @ 18:d95e72db5c07 r19-15b92

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