annotate lisp/gnus/nnfolder.el @ 38:1a767b41a199 r19-15b102

Import from CVS: tag r19-15b102
author cvs
date Mon, 13 Aug 2007 08:54:01 +0200
parents c53a95d3c46d
children 8b8b7f3559a2
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 ;;; nnfolder.el --- mail folder access for Gnus
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
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: Scott Byer <byer@mv.us.adobe.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Keywords: mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (require 'nnheader)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (require 'message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (require 'nnmail)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (require 'nnoo)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
34 (require 'cl)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
35 (require 'gnus-util)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (nnoo-declare nnfolder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defvoo nnfolder-directory (expand-file-name message-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "The name of the nnfolder directory.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
42 (defvoo nnfolder-active-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (nnheader-concat nnfolder-directory "active")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 "The name of the active file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; I renamed this variable to something more in keeping with the general GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; style. -SLB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (defvoo nnfolder-ignore-active-file nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 "If non-nil, causes nnfolder to do some extra work in order to determine
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 the true active ranges of an mbox file. Note that the active file is still
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
52 saved, but it's values are not used. This costs some extra time when
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 scanning an mbox when opening it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defvoo nnfolder-distrust-mbox nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "If non-nil, causes nnfolder to not trust the user with respect to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 inserting unaccounted for mail in the middle of an mbox file. This can greatly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 slow down scans, which now must scan the entire file for unmarked messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 When nil, scans occur forward from the last marked message, a huge
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 time saver for large mailboxes.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
62 (defvoo nnfolder-newsgroups-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (concat (file-name-as-directory nnfolder-directory) "newsgroups")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "Mail newsgroups description file.")
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 nnfolder-get-new-mail t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 "If non-nil, nnfolder will check the incoming mail file and split the mail.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (defvoo nnfolder-prepare-save-mail-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 "Hook run narrowed to an article before saving.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (defvoo nnfolder-save-buffer-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 "Hook run before saving the nnfolder mbox buffer.")
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 nnfolder-inhibit-expiry nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "If non-nil, inhibit expiry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (defconst nnfolder-version "nnfolder 1.0"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 "nnfolder version.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defconst nnfolder-article-marker "X-Gnus-Article-Number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 "String used to demarcate what the article number for a message is.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (defvoo nnfolder-current-group nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (defvoo nnfolder-current-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (defvoo nnfolder-status-string "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (defvoo nnfolder-group-alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (defvoo nnfolder-buffer-alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defvoo nnfolder-scantime-alist nil)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
92 (defvoo nnfolder-active-timestamp nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;;; Interface functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (nnoo-define-basics nnfolder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (deffoo nnfolder-retrieve-headers (articles &optional group server fetch-old)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (erase-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
104 (let (article art-string start stop)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (nnfolder-possibly-change-group group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (when nnfolder-current-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (if (stringp (car articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 'headers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (while articles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (setq article (car articles))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (setq art-string (nnfolder-article-string article))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (set-buffer nnfolder-current-buffer)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
115 (when (or (search-forward art-string nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
116 ;; Don't search the whole file twice! Also, articles
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
117 ;; probably have some locality by number, so searching
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
118 ;; backwards will be faster. Especially if we're at the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
119 ;; beginning of the buffer :-). -SLB
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
120 (search-backward art-string nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
121 (nnmail-search-unix-mail-delim-backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
122 (setq start (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
123 (search-forward "\n\n" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
124 (setq stop (1- (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
125 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
126 (insert (format "221 %d Article retrieved.\n" article))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
127 (insert-buffer-substring nnfolder-current-buffer start stop)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
128 (goto-char (point-max))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
129 (insert ".\n"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (setq articles (cdr articles)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (set-buffer nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (nnheader-fold-continuation-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 'headers)))))
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 nnfolder-open-server (server &optional defs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (nnoo-change-server 'nnfolder server defs)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
138 (nnmail-activate 'nnfolder t)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
139 (gnus-make-directory nnfolder-directory)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
140 (cond
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ((not (file-exists-p nnfolder-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (nnfolder-close-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (nnheader-report 'nnfolder "Couldn't create directory: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 nnfolder-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ((not (file-directory-p (file-truename nnfolder-directory)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (nnfolder-close-server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (nnheader-report 'nnfolder "Not a directory: %s" nnfolder-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (t
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
149 (nnmail-activate 'nnfolder)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (nnheader-report 'nnfolder "Opened server %s using directory %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 server nnfolder-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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (deffoo nnfolder-request-close ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (let ((alist nnfolder-buffer-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (while alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (nnfolder-close-group (caar alist) nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (setq alist (cdr alist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (nnoo-close-server 'nnfolder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (setq nnfolder-buffer-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 nnfolder-group-alist nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (deffoo nnfolder-request-article (article &optional group server buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (nnfolder-possibly-change-group group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
168 (when (search-forward (nnfolder-article-string article) nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
169 (let (start stop)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
170 (nnmail-search-unix-mail-delim-backward)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
171 (setq start (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
172 (forward-line 1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
173 (unless (and (nnmail-search-unix-mail-delim)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
174 (forward-line -1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
175 (goto-char (point-max)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
176 (setq stop (point))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
177 (let ((nntp-server-buffer (or buffer nntp-server-buffer)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
178 (set-buffer nntp-server-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
179 (erase-buffer)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
180 (insert-buffer-substring nnfolder-current-buffer start stop)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
181 (goto-char (point-min))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
182 (while (looking-at "From ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
183 (delete-char 5)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
184 (insert "X-From-Line: ")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
185 (forward-line 1))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
186 (if (numberp article)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
187 (cons nnfolder-current-group article)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
189 (search-forward (concat "\n" nnfolder-article-marker))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
190 (cons nnfolder-current-group
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
191 (string-to-int
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
192 (buffer-substring
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
193 (point) (progn (end-of-line) (point)))))))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (deffoo nnfolder-request-group (group &optional server dont-check)
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
196 (nnfolder-possibly-change-group group server t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (if (not (assoc group nnfolder-group-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (nnheader-report 'nnfolder "No such group: %s" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (if dont-check
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
201 (progn
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (nnheader-report 'nnfolder "Selected group %s" group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (let* ((active (assoc group nnfolder-group-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (group (car active))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (range (cadr active)))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
207 (cond
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ((null active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (nnheader-report 'nnfolder "No such group: %s" group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ((null nnfolder-current-group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (nnheader-report 'nnfolder "Empty group: %s" group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (nnheader-report 'nnfolder "Selected group %s" group)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
214 (nnheader-insert "211 %d %d %d %s\n"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (1+ (- (cdr range) (car range)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (car range) (cdr range) group))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (deffoo nnfolder-request-scan (&optional group server)
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
219 (nnfolder-possibly-change-group nil server)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
220 (when nnfolder-get-new-mail
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
221 (nnfolder-possibly-change-group group server)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
222 (nnmail-get-new-mail
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
223 'nnfolder
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
224 (lambda ()
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
225 (let ((bufs nnfolder-buffer-alist))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
226 (save-excursion
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
227 (while bufs
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 34
diff changeset
228 (if (not (buffer-live-p (nth 1 (car bufs))))
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
229 (setq nnfolder-buffer-alist
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
230 (delq (car bufs) nnfolder-buffer-alist))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
231 (set-buffer (nth 1 (car bufs)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
232 (nnfolder-save-buffer)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
233 (kill-buffer (current-buffer)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
234 (setq bufs (cdr bufs))))))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
235 nnfolder-directory
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
236 group)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ;; Don't close the buffer if we're not shutting down the server. This way,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;; we can keep the buffer in the group buffer cache, and not have to grovel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ;; over the buffer again unless we add new mail to it or modify it in some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (deffoo nnfolder-close-group (group &optional server force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;; Make sure we _had_ the group open.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (when (or (assoc group nnfolder-buffer-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (equal group nnfolder-current-group))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (let ((inf (assoc group nnfolder-buffer-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (when inf
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 34
diff changeset
249 (when (and nnfolder-current-group
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 34
diff changeset
250 nnfolder-current-buffer)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (push (list nnfolder-current-group nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 nnfolder-buffer-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (setq nnfolder-buffer-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (delq inf nnfolder-buffer-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (setq nnfolder-current-buffer (cadr inf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 nnfolder-current-group (car inf))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (when (and nnfolder-current-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (buffer-name nnfolder-current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;; If the buffer was modified, write the file out now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (nnfolder-save-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; If we're shutting the server down, we need to kill the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; buffer and remove it from the open buffer list. Or, of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;; course, if we're trying to minimize our space impact.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (setq nnfolder-buffer-alist (delq (assoc group nnfolder-buffer-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 nnfolder-buffer-alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (setq nnfolder-current-group nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 nnfolder-current-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
273 (deffoo nnfolder-request-create-group (group &optional server args)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (nnfolder-possibly-change-group nil server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (nnmail-activate 'nnfolder)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
276 (when group
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (unless (assoc group nnfolder-group-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (push (list group (cons 1 0)) nnfolder-group-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (deffoo nnfolder-request-list (&optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (nnfolder-possibly-change-group nil server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (nnmail-find-file nnfolder-active-file)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
286 (setq nnfolder-group-alist (nnmail-get-active))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
287 t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (deffoo nnfolder-request-newgroups (date &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (nnfolder-possibly-change-group nil server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (nnfolder-request-list server))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (deffoo nnfolder-request-list-newsgroups (&optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (nnfolder-possibly-change-group nil server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (nnmail-find-file nnfolder-newsgroups-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
298 (deffoo nnfolder-request-expire-articles
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (articles newsgroup &optional server force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (nnfolder-possibly-change-group newsgroup server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (let* ((is-old t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 rest)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (nnmail-activate 'nnfolder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
305 (save-excursion
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (while (and articles is-old)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
309 (when (search-forward (nnfolder-article-string (car articles)) nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
310 (if (setq is-old
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
311 (nnmail-expired-article-p
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
312 newsgroup
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
313 (buffer-substring
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
314 (point) (progn (end-of-line) (point)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
315 force nnfolder-inhibit-expiry))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
316 (progn
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
317 (nnheader-message 5 "Deleting article %d..."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
318 (car articles) newsgroup)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
319 (nnfolder-delete-mail))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
320 (push (car articles) rest)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (setq articles (cdr articles)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
322 (unless nnfolder-inhibit-expiry
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
323 (nnheader-message 5 "Deleting articles...done"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (nnfolder-save-buffer)
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
325 (nnfolder-adjust-min-active newsgroup)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (nconc rest articles))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (deffoo nnfolder-request-move-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (article group server accept-form &optional last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (let ((buf (get-buffer-create " *nnfolder move*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 result)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
333 (and
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (nnfolder-request-article article group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (buffer-disable-undo (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (insert-buffer-substring nntp-server-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (goto-char (point-min))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
341 (while (re-search-forward
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (concat "^" nnfolder-article-marker)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (save-excursion (search-forward "\n\n" nil t) (point)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (delete-region (progn (beginning-of-line) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (progn (forward-line 1) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (setq result (eval accept-form))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (kill-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (nnfolder-possibly-change-group group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
353 (when (search-forward (nnfolder-article-string article) nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
354 (nnfolder-delete-mail))
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
355 (when last
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
356 (nnfolder-save-buffer)
34
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
357 (nnfolder-adjust-min-active group)
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
358 (nnmail-save-active nnfolder-group-alist nnfolder-active-file))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (deffoo nnfolder-request-accept-article (group &optional server last)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (nnfolder-possibly-change-group group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (nnmail-check-syntax)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (let ((buf (current-buffer))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
365 result art-group)
0
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 (when (looking-at "X-From-Line: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (replace-match "From "))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
369 (and
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (nnfolder-request-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (search-forward "\n\n" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (forward-line -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (while (re-search-backward (concat "^" nnfolder-article-marker) nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (delete-region (point) (progn (forward-line 1) (point))))
38
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
378 (when nnmail-cache-accepted-message-ids
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
379 (nnmail-cache-insert (nnmail-fetch-field "message-id")))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
380 (setq result
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
381 (car (nnfolder-save-mail
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
382 (if (stringp group)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
383 (list (cons group (nnfolder-active-number group)))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
384 (setq art-group
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
385 (nnmail-article-group 'nnfolder-active-number)))))))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
386 (when last
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
387 (save-excursion
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
388 (nnfolder-possibly-change-folder (or (caar art-group) group))
38
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
389 (nnfolder-save-buffer)
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
390 (when nnmail-cache-accepted-message-ids
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
391 (nnmail-cache-close)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (unless result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (nnheader-report 'nnfolder "Couldn't store article"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (deffoo nnfolder-request-replace-article (article group buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (nnfolder-possibly-change-group group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (if (not (search-forward (nnfolder-article-string article) nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (nnfolder-delete-mail t t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (insert-buffer-substring buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (nnfolder-save-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (deffoo nnfolder-request-delete-group (group &optional force server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (nnfolder-close-group group server t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ;; Delete all articles in GROUP.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (if (not force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 () ; Don't delete the articles.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 ;; Delete the file that holds the group.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
415 (ignore-errors
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
416 (delete-file (nnfolder-group-pathname group))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ;; Remove the group from all structures.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
418 (setq nnfolder-group-alist
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (delq (assoc group nnfolder-group-alist) nnfolder-group-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 nnfolder-current-group nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 nnfolder-current-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 ;; Save the active file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (deffoo nnfolder-request-rename-group (group new-name &optional server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (nnfolder-possibly-change-group group server)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (set-buffer nnfolder-current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (and (file-writable-p buffer-file-name)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
431 (ignore-errors
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
432 (rename-file
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
433 buffer-file-name
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
434 (nnfolder-group-pathname new-name))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
435 t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 ;; That went ok, so we change the internal structures.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (let ((entry (assoc group nnfolder-group-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (and entry (setcar entry new-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (setq nnfolder-current-buffer nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 nnfolder-current-group nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 ;; Save the new group alist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 ;; We kill the buffer instead of renaming it and stuff.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 ;;; Internal functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
450 (defun nnfolder-adjust-min-active (group)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
451 ;; Find the lowest active article in this group.
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
452 (let* ((active (cadr (assoc group nnfolder-group-alist)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
453 (marker (concat "\n" nnfolder-article-marker))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
454 (number "[0-9]+")
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
455 (activemin (cdr active)))
34
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
456 (save-excursion
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
457 (set-buffer nnfolder-current-buffer)
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
458 (goto-char (point-min))
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
459 (while (and (search-forward marker nil t)
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
460 (re-search-forward number nil t))
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
461 (setq activemin (min activemin
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
462 (string-to-number (buffer-substring
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
463 (match-beginning 0)
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
464 (match-end 0))))))
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
465 (setcar active activemin))))
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
466
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (defun nnfolder-article-string (article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (if (numberp article)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (concat "\n" nnfolder-article-marker (int-to-string article) " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (concat "\nMessage-ID: " article)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (defun nnfolder-delete-mail (&optional force leave-delim)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 "Delete the message that point is in."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (delete-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (save-excursion
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
477 (nnmail-search-unix-mail-delim-backward)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (if leave-delim (progn (forward-line 1) (point))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
479 (point)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (forward-line 1)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
482 (if (nnmail-search-unix-mail-delim)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (if (and (not (bobp)) leave-delim)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (progn (forward-line -2) (point))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
485 (point))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (point-max))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
488 (defun nnfolder-possibly-change-group (group &optional server dont-check)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
489 ;; Change servers.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (when (and server
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (not (nnfolder-server-opened server)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (nnfolder-open-server server))
34
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
493 (unless (gnus-buffer-live-p nnfolder-current-buffer)
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
494 (setq nnfolder-current-buffer nil
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
495 nnfolder-current-group nil))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
496 ;; Change group.
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
497 (when (and group
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
498 (not (equal group nnfolder-current-group)))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
499 (nnmail-activate 'nnfolder)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
500 (when (and (not (assoc group nnfolder-group-alist))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
501 (not (file-exists-p
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
502 (nnfolder-group-pathname group))))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
503 ;; The group doesn't exist, so we create a new entry for it.
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
504 (push (list group (cons 1 0)) nnfolder-group-alist)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
505 (nnmail-save-active nnfolder-group-alist nnfolder-active-file))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
506
34
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
507 (if dont-check
d620409f5eb8 Import from CVS: tag r19-15b100
cvs
parents: 32
diff changeset
508 (setq nnfolder-current-group group)
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
509 (let (inf file)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
510 ;; If we have to change groups, see if we don't already have the
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
511 ;; folder in memory. If we do, verify the modtime and destroy
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
512 ;; the folder if needed so we can rescan it.
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
513 (when (setq inf (assoc group nnfolder-buffer-alist))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
514 (setq nnfolder-current-buffer (nth 1 inf)))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
515
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
516 ;; If the buffer is not live, make sure it isn't in the alist. If it
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
517 ;; is live, verify that nobody else has touched the file since last
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
518 ;; time.
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
519 (when (and nnfolder-current-buffer
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
520 (not (gnus-buffer-live-p nnfolder-current-buffer)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
521 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
522 nnfolder-current-buffer nil))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
523
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
524 (setq nnfolder-current-group group)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
525
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
526 (when (or (not nnfolder-current-buffer)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
527 (not (verify-visited-file-modtime nnfolder-current-buffer)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
528 (save-excursion
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
529 (setq file (nnfolder-group-pathname group))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
530 ;; See whether we need to create the new file.
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
531 (unless (file-exists-p file)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
532 (gnus-make-directory (file-name-directory file))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
533 (nnmail-write-region 1 1 file t 'nomesg))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
534 (when (setq nnfolder-current-buffer (nnfolder-read-folder group))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
535 (set-buffer nnfolder-current-buffer)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
536 (push (list group nnfolder-current-buffer)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
537 nnfolder-buffer-alist))))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
539 (defun nnfolder-save-mail (group-art-list)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 "Called narrowed to an article."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
541 (let* (save-list group-art)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (goto-char (point-min))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
543 ;; The From line may have been quoted by movemail.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
544 (when (looking-at (concat ">" message-unix-mail-delimiter))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
545 (delete-char 1))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
546 ;; This might come from somewhere else.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
547 (unless (looking-at message-unix-mail-delimiter)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (insert "From nobody " (current-time-string) "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (goto-char (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 ;; Quote all "From " lines in the article.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (forward-line 1)
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
552 (let (case-fold-search)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
553 (while (re-search-forward "^From " nil t)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
554 (beginning-of-line)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
555 (insert "> ")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (setq save-list group-art-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (nnmail-insert-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (nnmail-insert-xref group-art-list)
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 'nnfolder-prepare-save-mail-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 ;; Insert the mail into each of the destination groups.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
563 (while (setq group-art (pop group-art-list))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
564 ;; Kill any previous newsgroup markers.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (search-forward "\n\n" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (forward-line -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (while (search-backward (concat "\n" nnfolder-article-marker) nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (delete-region (1+ (point)) (progn (forward-line 2) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ;; Insert the new newsgroup marker.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (nnfolder-insert-newsgroup-line group-art)
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
573
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
574 (save-excursion
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
575 (let ((beg (point-min))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
576 (end (point-max))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
577 (obuf (current-buffer)))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
578 (nnfolder-possibly-change-folder (car group-art))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
579 (goto-char (point-max))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
580 (unless (eolp)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
581 (insert "\n"))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
582 (unless (bobp)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
583 (insert "\n"))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
584 (insert-buffer-substring obuf beg end))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 ;; Did we save it anywhere?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 save-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (defun nnfolder-insert-newsgroup-line (group-art)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
592 (when (search-forward "\n\n" nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
593 (forward-char -1)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
594 (insert (format (concat nnfolder-article-marker "%d %s\n")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
595 (cdr group-art) (current-time-string))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (defun nnfolder-active-number (group)
28
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
598 ;; Find the next article number in GROUP.
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
599 (let ((active (cadr (assoc group nnfolder-group-alist))))
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
600 (if active
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
601 (setcdr active (1+ (cdr active)))
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
602 ;; This group is new, so we create a new entry for it.
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
603 ;; This might be a bit naughty... creating groups on the drop of
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
604 ;; a hat, but I don't know...
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
605 (push (list group (setq active (cons 1 1)))
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
606 nnfolder-group-alist))
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
607 (cdr active)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
609 (defun nnfolder-possibly-change-folder (group)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
610 (let ((inf (assoc group nnfolder-buffer-alist)))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
611 (if (and inf
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
612 (gnus-buffer-live-p (cadr inf)))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
613 (set-buffer (cadr inf))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
614 (when inf
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
615 (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
616 (when nnfolder-group-alist
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
617 (nnmail-save-active nnfolder-group-alist nnfolder-active-file))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
618 (push (list group (nnfolder-read-folder group))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
619 nnfolder-buffer-alist))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 ;; This method has a problem if you've accidentally let the active list get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 ;; out of sync with the files. This could happen, say, if you've
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ;; accidentally gotten new mail with something other than Gnus (but why
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 ;; would _that_ ever happen? :-). In that case, we will be in the middle of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 ;; processing the file, ready to add new X-Gnus article number markers, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 ;; we'll run across a message with no ID yet - the active list _may_not_ be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 ;; ready for us yet.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 ;; To handle this, I'm modifying this routine to maintain the maximum ID seen
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 ;; so far, and when we hit a message with no ID, we will _manually_ scan the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 ;; rest of the message looking for any more, possibly higher IDs. We'll
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 ;; assume the maximum that we find is the highest active. Note that this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 ;; shouldn't cost us much extra time at all, but will be a lot less
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 ;; vulnerable to glitches between the mbox and the active file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
636 (defun nnfolder-read-folder (group)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
637 (let* ((file (nnfolder-group-pathname group))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
638 (buffer (set-buffer (nnheader-find-file-noselect file))))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
639 (if (equal (cadr (assoc group nnfolder-scantime-alist))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
640 (nth 5 (file-attributes file)))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
641 ;; This looks up-to-date, so we don't do any scanning.
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
642 buffer
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
643 ;; Parse the damn thing.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 (save-excursion
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
645 (nnmail-activate 'nnfolder)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 ;; Read in the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 (let ((delim (concat "^" message-unix-mail-delimiter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (marker (concat "\n" nnfolder-article-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (number "[0-9]+")
38
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
650 (active (or (cadr (assoc group nnfolder-group-alist))
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
651 (cons 1 0)))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
652 (scantime (assoc group nnfolder-scantime-alist))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 (minid (lsh -1 -1))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
654 maxid start end newscantime
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
655 buffer-read-only)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
656 (buffer-disable-undo (current-buffer))
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
657 (setq maxid (cdr active))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 ;; Anytime the active number is 1 or 0, it is suspect. In that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 ;; case, search the file manually to find the active number. Or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 ;; of course, if we're being paranoid. (This would also be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 ;; place to build other lists from the header markers, such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 ;; expunge lists, etc., if we ever desired to abandon the active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 ;; file entirely for mboxes.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (when (or nnfolder-ignore-active-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (< maxid 2))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
668 (while (and (search-forward marker nil t)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
669 (re-search-forward number nil t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
670 (let ((newnum (string-to-number (match-string 0))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
671 (setq maxid (max maxid newnum))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
672 (setq minid (min minid newnum))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
673 (setcar active (max 1 (min minid maxid)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
674 (setcdr active (max maxid (cdr active)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
675 (goto-char (point-min)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 ;; As long as we trust that the user will only insert unmarked mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 ;; at the end, go to the end and search backwards for the last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 ;; marker. Find the start of that message, and begin to search for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 ;; unmarked messages from there.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
681 (when (not (or nnfolder-distrust-mbox
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
682 (< maxid 2)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
683 (goto-char (point-max))
38
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
684 (unless (re-search-backward marker nil t)
1a767b41a199 Import from CVS: tag r19-15b102
cvs
parents: 36
diff changeset
685 (goto-char (point-min))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 ;; Keep track of the active number on our own, and insert it back
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
688 ;; into the active list when we're done. Also, prime the pump to
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 ;; cut down on the number of searches we do.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
690 (unless (nnmail-search-unix-mail-delim)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
691 (goto-char (point-max)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (setq end (point-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (while (not (= end (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (setq start (marker-position end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 ;; There may be more than one "From " line, so we skip past
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
697 ;; them.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
698 (while (looking-at delim)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (forward-line 1))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
700 (set-marker end (if (nnmail-search-unix-mail-delim)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
701 (point)
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
702 (point-max)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (goto-char start)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
704 (when (not (search-forward marker end t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
705 (narrow-to-region start end)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
706 (nnmail-insert-lines)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
707 (nnfolder-insert-newsgroup-line
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
708 (cons nil (nnfolder-active-number nnfolder-current-group)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
709 (widen)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
711 (set-marker end nil)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 ;; Make absolutely sure that the active list reflects reality!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (nnmail-save-active nnfolder-group-alist nnfolder-active-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 ;; Set the scantime for this group.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (setq newscantime (visited-file-modtime))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (if scantime
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (setcdr scantime (list newscantime))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
718 (push (list nnfolder-current-group newscantime)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 nnfolder-scantime-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (current-buffer))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (defun nnfolder-generate-active-file ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 "Look for mbox folders in the nnfolder directory and make them into groups."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (nnmail-activate 'nnfolder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (let ((files (directory-files nnfolder-directory))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
728 file)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (while (setq file (pop files))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (when (and (not (backup-file-name-p file))
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
731 (message-mail-file-mbox-p
32
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
732 (nnheader-concat nnfolder-directory file)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
733 (let ((oldgroup (assoc file nnfolder-group-alist)))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
734 (if oldgroup
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
735 (nnheader-message 5 "Refreshing group %s..." file)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
736 (nnheader-message 5 "Adding group %s..." file))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
737 (setq nnfolder-group-alist (remove oldgroup nnfolder-group-alist))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
738 (push (list file (cons 1 0)) nnfolder-group-alist)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
739 (nnfolder-possibly-change-folder file)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
740 (nnfolder-possibly-change-group file)
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
741 (nnfolder-close-group file))))
e04119814345 Import from CVS: tag r19-15b99
cvs
parents: 30
diff changeset
742 (message "")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (defun nnfolder-group-pathname (group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 "Make pathname for GROUP."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (let ((dir (file-name-as-directory (expand-file-name nnfolder-directory))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 ;; If this file exists, we use it directly.
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents: 28
diff changeset
748 (if (or nnmail-use-long-file-names
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (file-exists-p (concat dir group)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (concat dir group)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 ;; If not, we translate dots into slashes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (concat dir (nnheader-replace-chars-in-string group ?. ?/)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (defun nnfolder-save-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 "Save the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (when (buffer-modified-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (run-hooks 'nnfolder-save-buffer-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (save-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (provide 'nnfolder)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 ;;; nnfolder.el ends here