Mercurial > emacs
annotate lisp/gnus/nnmbox.el @ 94148:be53eb871301
(dired-omit-files-p): Use `define-obsolete-variable-alias'.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 18 Apr 2008 09:32:42 +0000 |
parents | 1e3a407766b9 |
children | f42ef85caf91 |
rev | line source |
---|---|
17493 | 1 ;;; nnmbox.el --- mail mbox access for Gnus |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
2 |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, |
79708 | 4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
7 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet> |
17493 | 8 ;; Keywords: news, mail |
9 | |
10 ;; This file is part of GNU Emacs. | |
11 | |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
78224
24202b793a08
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
14 ;; the Free Software Foundation; either version 3, or (at your option) |
17493 | 15 ;; any later version. |
16 | |
17 ;; You should have received a copy of the GNU General Public License | |
18 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64085 | 19 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 ;; Boston, MA 02110-1301, USA. | |
17493 | 21 |
22 ;;; Commentary: | |
23 | |
24 ;; For an overview of what the interface functions do, please see the | |
25 ;; Gnus sources. | |
26 | |
27 ;;; Code: | |
28 | |
29 (require 'nnheader) | |
30 (require 'message) | |
31 (require 'nnmail) | |
32 (require 'nnoo) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
33 (require 'gnus-range) |
17493 | 34 (eval-when-compile (require 'cl)) |
35 | |
36 (nnoo-declare nnmbox) | |
37 | |
38 (defvoo nnmbox-mbox-file (expand-file-name "~/mbox") | |
39 "The name of the mail box file in the user's home directory.") | |
40 | |
41 (defvoo nnmbox-active-file (expand-file-name "~/.mbox-active") | |
42 "The name of the active file for the mail box.") | |
43 | |
44 (defvoo nnmbox-get-new-mail t | |
45 "If non-nil, nnmbox will check the incoming mail file and split the mail.") | |
46 | |
47 (defvoo nnmbox-prepare-save-mail-hook nil | |
48 "Hook run narrowed to an article before saving.") | |
49 | |
50 | |
51 | |
52 (defconst nnmbox-version "nnmbox 1.0" | |
53 "nnmbox version.") | |
54 | |
55 (defvoo nnmbox-current-group nil | |
56 "Current nnmbox news group directory.") | |
57 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
58 (defvar nnmbox-mbox-buffer nil) |
17493 | 59 |
60 (defvoo nnmbox-status-string "") | |
61 | |
62 (defvoo nnmbox-group-alist nil) | |
63 (defvoo nnmbox-active-timestamp nil) | |
64 | |
34752
f04f551e94ce
* message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
31716
diff
changeset
|
65 (defvoo nnmbox-file-coding-system mm-binary-coding-system) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
66 (defvoo nnmbox-file-coding-system-for-write nil) |
34752
f04f551e94ce
* message.el (message-narrow-to-head-1): New function.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
31716
diff
changeset
|
67 (defvoo nnmbox-active-file-coding-system mm-binary-coding-system) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
68 (defvoo nnmbox-active-file-coding-system-for-write nil) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
69 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
70 (defvar nnmbox-group-building-active-articles nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
71 (defvar nnmbox-group-active-articles nil) |
17493 | 72 |
73 | |
74 ;;; Interface functions | |
75 | |
76 (nnoo-define-basics nnmbox) | |
77 | |
78 (deffoo nnmbox-retrieve-headers (sequence &optional newsgroup server fetch-old) | |
79 (save-excursion | |
80 (set-buffer nntp-server-buffer) | |
81 (erase-buffer) | |
82 (let ((number (length sequence)) | |
83 (count 0) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
84 article start stop) |
17493 | 85 (nnmbox-possibly-change-newsgroup newsgroup server) |
86 (while sequence | |
87 (setq article (car sequence)) | |
88 (set-buffer nnmbox-mbox-buffer) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
89 (when (nnmbox-find-article article) |
17493 | 90 (setq start |
91 (save-excursion | |
92 (re-search-backward | |
93 (concat "^" message-unix-mail-delimiter) nil t) | |
94 (point))) | |
95 (search-forward "\n\n" nil t) | |
96 (setq stop (1- (point))) | |
97 (set-buffer nntp-server-buffer) | |
98 (insert (format "221 %d Article retrieved.\n" article)) | |
99 (insert-buffer-substring nnmbox-mbox-buffer start stop) | |
100 (goto-char (point-max)) | |
101 (insert ".\n")) | |
102 (setq sequence (cdr sequence)) | |
103 (setq count (1+ count)) | |
104 (and (numberp nnmail-large-newsgroup) | |
105 (> number nnmail-large-newsgroup) | |
106 (zerop (% count 20)) | |
107 (nnheader-message 5 "nnmbox: Receiving headers... %d%%" | |
108 (/ (* count 100) number)))) | |
109 | |
110 (and (numberp nnmail-large-newsgroup) | |
111 (> number nnmail-large-newsgroup) | |
112 (nnheader-message 5 "nnmbox: Receiving headers...done")) | |
113 | |
114 (set-buffer nntp-server-buffer) | |
115 (nnheader-fold-continuation-lines) | |
116 'headers))) | |
117 | |
118 (deffoo nnmbox-open-server (server &optional defs) | |
119 (nnoo-change-server 'nnmbox server defs) | |
120 (nnmbox-create-mbox) | |
121 (cond | |
122 ((not (file-exists-p nnmbox-mbox-file)) | |
123 (nnmbox-close-server) | |
124 (nnheader-report 'nnmbox "No such file: %s" nnmbox-mbox-file)) | |
125 ((file-directory-p nnmbox-mbox-file) | |
126 (nnmbox-close-server) | |
127 (nnheader-report 'nnmbox "Not a regular file: %s" nnmbox-mbox-file)) | |
128 (t | |
129 (nnheader-report 'nnmbox "Opened server %s using mbox %s" server | |
130 nnmbox-mbox-file) | |
131 t))) | |
132 | |
133 (deffoo nnmbox-close-server (&optional server) | |
134 (when (and nnmbox-mbox-buffer | |
135 (buffer-name nnmbox-mbox-buffer)) | |
136 (kill-buffer nnmbox-mbox-buffer)) | |
137 (nnoo-close-server 'nnmbox server) | |
138 t) | |
139 | |
140 (deffoo nnmbox-server-opened (&optional server) | |
141 (and (nnoo-current-server-p 'nnmbox server) | |
142 nnmbox-mbox-buffer | |
143 (buffer-name nnmbox-mbox-buffer) | |
144 nntp-server-buffer | |
145 (buffer-name nntp-server-buffer))) | |
146 | |
147 (deffoo nnmbox-request-article (article &optional newsgroup server buffer) | |
148 (nnmbox-possibly-change-newsgroup newsgroup server) | |
149 (save-excursion | |
150 (set-buffer nnmbox-mbox-buffer) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
151 (when (nnmbox-find-article article) |
17493 | 152 (let (start stop) |
153 (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) | |
154 (setq start (point)) | |
155 (forward-line 1) | |
79022 | 156 (setq stop (if (re-search-forward (concat "^" |
157 message-unix-mail-delimiter) | |
158 nil 'move) | |
159 (match-beginning 0) | |
160 (point))) | |
17493 | 161 (let ((nntp-server-buffer (or buffer nntp-server-buffer))) |
162 (set-buffer nntp-server-buffer) | |
163 (erase-buffer) | |
164 (insert-buffer-substring nnmbox-mbox-buffer start stop) | |
165 (goto-char (point-min)) | |
166 (while (looking-at "From ") | |
167 (delete-char 5) | |
168 (insert "X-From-Line: ") | |
169 (forward-line 1)) | |
170 (if (numberp article) | |
171 (cons nnmbox-current-group article) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
172 (nnmbox-article-group-number nil))))))) |
17493 | 173 |
174 (deffoo nnmbox-request-group (group &optional server dont-check) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
175 (nnmbox-possibly-change-newsgroup nil server) |
17493 | 176 (let ((active (cadr (assoc group nnmbox-group-alist)))) |
177 (cond | |
178 ((or (null active) | |
179 (null (nnmbox-possibly-change-newsgroup group server))) | |
180 (nnheader-report 'nnmbox "No such group: %s" group)) | |
181 (dont-check | |
182 (nnheader-report 'nnmbox "Selected group %s" group) | |
183 (nnheader-insert "")) | |
184 (t | |
185 (nnheader-report 'nnmbox "Selected group %s" group) | |
186 (nnheader-insert "211 %d %d %d %s\n" | |
187 (1+ (- (cdr active) (car active))) | |
188 (car active) (cdr active) group))))) | |
189 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
190 (defun nnmbox-save-buffer () |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47002
diff
changeset
|
191 (let ((coding-system-for-write |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
192 (or nnmbox-file-coding-system-for-write |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
193 nnmbox-file-coding-system))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
194 (save-buffer))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
195 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
196 (defun nnmbox-save-active (group-alist active-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
197 (let ((nnmail-active-file-coding-system |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
198 (or nnmbox-active-file-coding-system-for-write |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
199 nnmbox-active-file-coding-system))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
200 (nnmail-save-active group-alist active-file))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
201 |
17493 | 202 (deffoo nnmbox-request-scan (&optional group server) |
203 (nnmbox-possibly-change-newsgroup group server) | |
204 (nnmbox-read-mbox) | |
205 (nnmail-get-new-mail | |
206 'nnmbox | |
207 (lambda () | |
208 (save-excursion | |
209 (set-buffer nnmbox-mbox-buffer) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
210 (nnmbox-save-buffer))) |
17493 | 211 (file-name-directory nnmbox-mbox-file) |
212 group | |
213 (lambda () | |
214 (save-excursion | |
215 (let ((in-buf (current-buffer))) | |
216 (set-buffer nnmbox-mbox-buffer) | |
217 (goto-char (point-max)) | |
218 (insert-buffer-substring in-buf))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
219 (nnmbox-save-active nnmbox-group-alist nnmbox-active-file)))) |
17493 | 220 |
221 (deffoo nnmbox-close-group (group &optional server) | |
222 t) | |
223 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
224 (deffoo nnmbox-request-create-group (group &optional server args) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
225 (nnmail-activate 'nnmbox) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
226 (unless (assoc group nnmbox-group-alist) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
227 (push (list group (cons 1 0)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
228 nnmbox-group-alist) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
229 (nnmbox-save-active nnmbox-group-alist nnmbox-active-file)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
230 t) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
17493
diff
changeset
|
231 |
17493 | 232 (deffoo nnmbox-request-list (&optional server) |
233 (save-excursion | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
234 (let ((nnmail-file-coding-system |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
235 nnmbox-active-file-coding-system)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
236 (nnmail-find-file nnmbox-active-file)) |
17493 | 237 (setq nnmbox-group-alist (nnmail-get-active)) |
238 t)) | |
239 | |
240 (deffoo nnmbox-request-newgroups (date &optional server) | |
241 (nnmbox-request-list server)) | |
242 | |
243 (deffoo nnmbox-request-list-newsgroups (&optional server) | |
244 (nnheader-report 'nnmbox "LIST NEWSGROUPS is not implemented.")) | |
245 | |
246 (deffoo nnmbox-request-expire-articles | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
247 (articles newsgroup &optional server force) |
17493 | 248 (nnmbox-possibly-change-newsgroup newsgroup server) |
249 (let* ((is-old t) | |
250 rest) | |
251 (nnmail-activate 'nnmbox) | |
252 | |
253 (save-excursion | |
254 (set-buffer nnmbox-mbox-buffer) | |
255 (while (and articles is-old) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
256 (when (nnmbox-find-article (car articles)) |
17493 | 257 (if (setq is-old |
258 (nnmail-expired-article-p | |
259 newsgroup | |
260 (buffer-substring | |
261 (point) (progn (end-of-line) (point))) force)) | |
262 (progn | |
47002
b87254142b98
* nnfolder.el (nnfolder-request-expire-articles): expiry-target.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
44511
diff
changeset
|
263 (unless (eq nnmail-expiry-target 'delete) |
b87254142b98
* nnfolder.el (nnfolder-request-expire-articles): expiry-target.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
44511
diff
changeset
|
264 (with-temp-buffer |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47002
diff
changeset
|
265 (nnmbox-request-article (car articles) |
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
47002
diff
changeset
|
266 newsgroup server |
47002
b87254142b98
* nnfolder.el (nnfolder-request-expire-articles): expiry-target.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
44511
diff
changeset
|
267 (current-buffer)) |
b87254142b98
* nnfolder.el (nnfolder-request-expire-articles): expiry-target.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
44511
diff
changeset
|
268 (let ((nnml-current-directory nil)) |
b87254142b98
* nnfolder.el (nnfolder-request-expire-articles): expiry-target.
ShengHuo ZHU <zsh@cs.rochester.edu>
parents:
44511
diff
changeset
|
269 (nnmail-expiry-target-group |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
270 nnmail-expiry-target newsgroup))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
271 (nnmbox-possibly-change-newsgroup newsgroup server)) |
17493 | 272 (nnheader-message 5 "Deleting article %d in %s..." |
273 (car articles) newsgroup) | |
274 (nnmbox-delete-mail)) | |
275 (push (car articles) rest))) | |
276 (setq articles (cdr articles))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
277 (nnmbox-save-buffer) |
17493 | 278 ;; Find the lowest active article in this group. |
279 (let ((active (nth 1 (assoc newsgroup nnmbox-group-alist)))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
280 (while (and (not (nnmbox-find-article (car active))) |
17493 | 281 (<= (car active) (cdr active))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
282 (setcar active (1+ (car active))))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
283 (nnmbox-save-active nnmbox-group-alist nnmbox-active-file) |
17493 | 284 (nconc rest articles)))) |
285 | |
286 (deffoo nnmbox-request-move-article | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
79022
diff
changeset
|
287 (article group server accept-form &optional last move-is-internal) |
17493 | 288 (let ((buf (get-buffer-create " *nnmbox move*")) |
289 result) | |
290 (and | |
291 (nnmbox-request-article article group server) | |
292 (save-excursion | |
293 (set-buffer buf) | |
294 (erase-buffer) | |
295 (insert-buffer-substring nntp-server-buffer) | |
296 (goto-char (point-min)) | |
297 (while (re-search-forward | |
298 "^X-Gnus-Newsgroup:" | |
299 (save-excursion (search-forward "\n\n" nil t) (point)) t) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
300 (gnus-delete-line)) |
17493 | 301 (setq result (eval accept-form)) |
302 (kill-buffer buf) | |
303 result) | |
304 (save-excursion | |
305 (nnmbox-possibly-change-newsgroup group server) | |
306 (set-buffer nnmbox-mbox-buffer) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
307 (when (nnmbox-find-article article) |
17493 | 308 (nnmbox-delete-mail)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
309 (and last (nnmbox-save-buffer)))) |
17493 | 310 result)) |
311 | |
312 (deffoo nnmbox-request-accept-article (group &optional server last) | |
313 (nnmbox-possibly-change-newsgroup group server) | |
314 (nnmail-check-syntax) | |
315 (let ((buf (current-buffer)) | |
79022 | 316 result cont) |
17493 | 317 (and |
318 (nnmail-activate 'nnmbox) | |
79022 | 319 (with-temp-buffer |
320 (insert-buffer-substring buf) | |
17493 | 321 (goto-char (point-min)) |
79022 | 322 (cond (;; The From line may have been quoted by movemail. |
323 (looking-at (concat ">" message-unix-mail-delimiter)) | |
324 (delete-char 1) | |
325 (forward-line 1)) | |
326 ((looking-at "X-From-Line: ") | |
327 (replace-match "From ") | |
328 (forward-line 1)) | |
329 (t | |
330 (insert "From nobody " (current-time-string) "\n"))) | |
331 (narrow-to-region (point) | |
332 (if (search-forward "\n\n" nil 'move) | |
333 (1- (point)) | |
334 (point))) | |
17493 | 335 (while (re-search-backward "^X-Gnus-Newsgroup: " nil t) |
336 (delete-region (point) (progn (forward-line 1) (point)))) | |
337 (when nnmail-cache-accepted-message-ids | |
79022 | 338 (nnmail-cache-insert (message-fetch-field "message-id") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
339 group |
79022 | 340 (message-fetch-field "subject") |
341 (message-fetch-field "from"))) | |
342 (widen) | |
17493 | 343 (setq result (if (stringp group) |
344 (list (cons group (nnmbox-active-number group))) | |
345 (nnmail-article-group 'nnmbox-active-number))) | |
79022 | 346 (prog1 |
347 (if (and (null result) | |
348 (yes-or-no-p "Moved to `junk' group; delete article? ")) | |
349 (setq result 'junk) | |
350 (setq result (car (nnmbox-save-mail result)))) | |
351 (setq cont (buffer-string)))) | |
352 (with-current-buffer nnmbox-mbox-buffer | |
17493 | 353 (goto-char (point-max)) |
79022 | 354 (insert cont) |
17493 | 355 (when last |
356 (when nnmail-cache-accepted-message-ids | |
357 (nnmail-cache-close)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
358 (nnmbox-save-active nnmbox-group-alist nnmbox-active-file) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
359 (nnmbox-save-buffer)))) |
17493 | 360 result)) |
361 | |
362 (deffoo nnmbox-request-replace-article (article group buffer) | |
363 (nnmbox-possibly-change-newsgroup group) | |
364 (save-excursion | |
365 (set-buffer nnmbox-mbox-buffer) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
366 (if (not (nnmbox-find-article article)) |
17493 | 367 nil |
368 (nnmbox-delete-mail t t) | |
79022 | 369 (insert |
370 (with-temp-buffer | |
371 (insert-buffer-substring buffer) | |
372 (goto-char (point-min)) | |
373 (when (looking-at "X-From-Line:") | |
374 (delete-region (point) (progn (forward-line 1) (point)))) | |
375 (while (re-search-forward (concat "^" message-unix-mail-delimiter) | |
376 nil t) | |
377 (goto-char (match-beginning 0)) | |
378 (insert ">")) | |
379 (goto-char (point-max)) | |
380 (unless (bolp) | |
381 (insert "\n")) | |
382 (buffer-string))) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
383 (nnmbox-save-buffer) |
17493 | 384 t))) |
385 | |
386 (deffoo nnmbox-request-delete-group (group &optional force server) | |
387 (nnmbox-possibly-change-newsgroup group server) | |
388 ;; Delete all articles in GROUP. | |
389 (if (not force) | |
390 () ; Don't delete the articles. | |
391 (save-excursion | |
392 (set-buffer nnmbox-mbox-buffer) | |
393 (goto-char (point-min)) | |
394 ;; Delete all articles in this group. | |
395 (let ((ident (concat "\nX-Gnus-Newsgroup: " nnmbox-current-group ":")) | |
396 found) | |
397 (while (search-forward ident nil t) | |
398 (setq found t) | |
399 (nnmbox-delete-mail)) | |
400 (when found | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
401 (nnmbox-save-buffer))))) |
17493 | 402 ;; Remove the group from all structures. |
403 (setq nnmbox-group-alist | |
404 (delq (assoc group nnmbox-group-alist) nnmbox-group-alist) | |
405 nnmbox-current-group nil) | |
406 ;; Save the active file. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
407 (nnmbox-save-active nnmbox-group-alist nnmbox-active-file) |
17493 | 408 t) |
409 | |
410 (deffoo nnmbox-request-rename-group (group new-name &optional server) | |
411 (nnmbox-possibly-change-newsgroup group server) | |
412 (save-excursion | |
413 (set-buffer nnmbox-mbox-buffer) | |
414 (goto-char (point-min)) | |
415 (let ((ident (concat "\nX-Gnus-Newsgroup: " nnmbox-current-group ":")) | |
416 (new-ident (concat "\nX-Gnus-Newsgroup: " new-name ":")) | |
417 found) | |
418 (while (search-forward ident nil t) | |
419 (replace-match new-ident t t) | |
420 (setq found t)) | |
421 (when found | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
422 (nnmbox-save-buffer)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
423 (let ((entry (assoc group nnmbox-group-active-articles))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
424 (when entry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
425 (setcar entry new-name))) |
17493 | 426 (let ((entry (assoc group nnmbox-group-alist))) |
427 (when entry | |
428 (setcar entry new-name)) | |
429 (setq nnmbox-current-group nil) | |
430 ;; Save the new group alist. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
431 (nnmbox-save-active nnmbox-group-alist nnmbox-active-file) |
17493 | 432 t)) |
433 | |
434 | |
435 ;;; Internal functions. | |
436 | |
437 ;; If FORCE, delete article no matter how many X-Gnus-Newsgroup | |
438 ;; headers there are. If LEAVE-DELIM, don't delete the Unix mbox | |
439 ;; delimiter line. | |
440 (defun nnmbox-delete-mail (&optional force leave-delim) | |
441 ;; Delete the current X-Gnus-Newsgroup line. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
442 ;; First delete record of active article, unless the article is being |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
443 ;; replaced, indicated by FORCE being non-nil. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
444 (if (not force) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
445 (nnmbox-record-deleted-article (nnmbox-article-group-number t))) |
17493 | 446 (or force |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
447 (gnus-delete-line)) |
17493 | 448 ;; Beginning of the article. |
449 (save-excursion | |
450 (save-restriction | |
451 (narrow-to-region | |
79022 | 452 (prog2 |
453 (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) | |
454 (if leave-delim (progn (forward-line 1) (point)) | |
455 (match-beginning 0)) | |
456 (forward-line 1)) | |
457 (or (and (re-search-forward (concat "^" message-unix-mail-delimiter) | |
458 nil t) | |
459 (match-beginning 0)) | |
460 (point-max))) | |
17493 | 461 (goto-char (point-min)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
462 ;; Only delete the article if no other group owns it as well. |
79022 | 463 (when (or force |
464 (not (re-search-forward "^X-Gnus-Newsgroup: " nil t)) | |
465 (search-backward "\n\n" nil t)) | |
17493 | 466 (delete-region (point-min) (point-max)))))) |
467 | |
468 (defun nnmbox-possibly-change-newsgroup (newsgroup &optional server) | |
469 (when (and server | |
470 (not (nnmbox-server-opened server))) | |
471 (nnmbox-open-server server)) | |
472 (when (or (not nnmbox-mbox-buffer) | |
473 (not (buffer-name nnmbox-mbox-buffer))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
474 (nnmbox-read-mbox)) |
17493 | 475 (when (not nnmbox-group-alist) |
476 (nnmail-activate 'nnmbox)) | |
477 (if newsgroup | |
478 (when (assoc newsgroup nnmbox-group-alist) | |
479 (setq nnmbox-current-group newsgroup)) | |
480 t)) | |
481 | |
482 (defun nnmbox-article-string (article) | |
483 (if (numberp article) | |
484 (concat "\nX-Gnus-Newsgroup: " nnmbox-current-group ":" | |
485 (int-to-string article) " ") | |
486 (concat "\nMessage-ID: " article))) | |
487 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
488 (defun nnmbox-article-group-number (this-line) |
17493 | 489 (save-excursion |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
490 (if this-line |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
491 (beginning-of-line) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
492 (goto-char (point-min))) |
17493 | 493 (when (re-search-forward "^X-Gnus-Newsgroup: +\\([^:]+\\):\\([0-9]+\\) " |
494 nil t) | |
495 (cons (buffer-substring (match-beginning 1) (match-end 1)) | |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
496 (string-to-number |
17493 | 497 (buffer-substring (match-beginning 2) (match-end 2))))))) |
498 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
499 (defun nnmbox-in-header-p (pos) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
500 "Return non-nil if POS is in the header of an article." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
501 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
502 (goto-char pos) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
503 (re-search-backward (concat "^" message-unix-mail-delimiter) nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
504 (search-forward "\n\n" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
505 (< pos (point)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
506 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
507 (defun nnmbox-find-article (article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
508 "Leaves point on the relevant X-Gnus-Newsgroup line if found." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
509 ;; Check that article is in the active range first, to avoid an |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
510 ;; expensive exhaustive search if it isn't. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
511 (if (and (numberp article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
512 (not (nnmbox-is-article-active-p article))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
513 nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
514 (let ((art-string (nnmbox-article-string article)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
515 (found nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
516 ;; There is the possibility that the X-Gnus-Newsgroup line appears |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
517 ;; in the body of an article (for instance, if an article has been |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
518 ;; forwarded from someone using Gnus as their mailer), so check |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
519 ;; that the line is actually part of the article header. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
520 (or (and (search-forward art-string nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
521 (nnmbox-in-header-p (point))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
522 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
523 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
524 (while (and (not found) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
525 (search-forward art-string nil t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
526 (setq found (nnmbox-in-header-p (point)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
527 found))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
528 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
529 (defun nnmbox-record-active-article (group-art) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
530 (let* ((group (car group-art)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
531 (article (cdr group-art)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
532 (entry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
533 (or (assoc group nnmbox-group-active-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
534 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
535 (push (list group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
536 nnmbox-group-active-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
537 (car nnmbox-group-active-articles))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
538 ;; add article to index, either by building complete list |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
539 ;; in reverse order, or as a list of ranges. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
540 (if (not nnmbox-group-building-active-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
541 (setcdr entry (gnus-add-to-range (cdr entry) (list article))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
542 (when (memq article (cdr entry)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
543 (switch-to-buffer nnmbox-mbox-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
544 (error "Article %s:%d already exists!" group article)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
545 (when (and (cadr entry) (< article (cadr entry))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
546 (switch-to-buffer nnmbox-mbox-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
547 (error "Article %s:%d out of order" group article)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
548 (setcdr entry (cons article (cdr entry)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
549 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
550 (defun nnmbox-record-deleted-article (group-art) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
551 (let* ((group (car group-art)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
552 (article (cdr group-art)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
553 (entry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
554 (or (assoc group nnmbox-group-active-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
555 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
556 (push (list group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
557 nnmbox-group-active-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
558 (car nnmbox-group-active-articles))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
559 ;; remove article from index |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
560 (setcdr entry (gnus-remove-from-range (cdr entry) (list article))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
561 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
562 (defun nnmbox-is-article-active-p (article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
563 (gnus-member-of-range |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
564 article |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
565 (cdr (assoc nnmbox-current-group |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
566 nnmbox-group-active-articles)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
567 |
17493 | 568 (defun nnmbox-save-mail (group-art) |
569 "Called narrowed to an article." | |
570 (let ((delim (concat "^" message-unix-mail-delimiter))) | |
571 (goto-char (point-min)) | |
572 ;; This might come from somewhere else. | |
79022 | 573 (if (looking-at delim) |
574 (forward-line 1) | |
575 (insert "From nobody " (current-time-string) "\n")) | |
17493 | 576 ;; Quote all "From " lines in the article. |
577 (while (re-search-forward delim nil t) | |
79022 | 578 (goto-char (match-beginning 0)) |
579 (insert ">"))) | |
580 (goto-char (point-max)) | |
581 (unless (bolp) | |
582 (insert "\n")) | |
583 (nnmail-insert-lines) | |
584 (nnmail-insert-xref group-art) | |
585 (nnmbox-insert-newsgroup-line group-art) | |
586 (let ((alist group-art)) | |
587 (while alist | |
588 (nnmbox-record-active-article (car alist)) | |
589 (setq alist (cdr alist)))) | |
590 (run-hooks 'nnmail-prepare-save-mail-hook) | |
591 (run-hooks 'nnmbox-prepare-save-mail-hook) | |
592 group-art) | |
17493 | 593 |
594 (defun nnmbox-insert-newsgroup-line (group-art) | |
595 (save-excursion | |
596 (goto-char (point-min)) | |
597 (when (search-forward "\n\n" nil t) | |
598 (forward-char -1) | |
599 (while group-art | |
600 (insert (format "X-Gnus-Newsgroup: %s:%d %s\n" | |
601 (caar group-art) (cdar group-art) | |
602 (current-time-string))) | |
603 (setq group-art (cdr group-art)))) | |
604 t)) | |
605 | |
606 (defun nnmbox-active-number (group) | |
607 ;; Find the next article number in GROUP. | |
608 (let ((active (cadr (assoc group nnmbox-group-alist)))) | |
609 (if active | |
610 (setcdr active (1+ (cdr active))) | |
611 ;; This group is new, so we create a new entry for it. | |
612 ;; This might be a bit naughty... creating groups on the drop of | |
613 ;; a hat, but I don't know... | |
614 (push (list group (setq active (cons 1 1))) | |
615 nnmbox-group-alist)) | |
616 (cdr active))) | |
617 | |
618 (defun nnmbox-create-mbox () | |
619 (when (not (file-exists-p nnmbox-mbox-file)) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
620 (let ((nnmail-file-coding-system |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
621 (or nnmbox-file-coding-system-for-write |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
622 nnmbox-file-coding-system)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
623 (dir (file-name-directory nnmbox-mbox-file))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
624 (and dir (gnus-make-directory dir)) |
44511
5c5bc6fd4eb8
(nnmbox-create-mbox): Don't assume point-min == 1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
34752
diff
changeset
|
625 (nnmail-write-region (point-min) (point-min) |
5c5bc6fd4eb8
(nnmbox-create-mbox): Don't assume point-min == 1.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
34752
diff
changeset
|
626 nnmbox-mbox-file t 'nomesg)))) |
17493 | 627 |
628 (defun nnmbox-read-mbox () | |
629 (nnmail-activate 'nnmbox) | |
630 (nnmbox-create-mbox) | |
631 (if (and nnmbox-mbox-buffer | |
632 (buffer-name nnmbox-mbox-buffer) | |
633 (save-excursion | |
634 (set-buffer nnmbox-mbox-buffer) | |
635 (= (buffer-size) (nnheader-file-size nnmbox-mbox-file)))) | |
636 () | |
637 (save-excursion | |
638 (let ((delim (concat "^" message-unix-mail-delimiter)) | |
639 (alist nnmbox-group-alist) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
640 (nnmbox-group-building-active-articles t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
641 start end end-header number) |
17493 | 642 (set-buffer (setq nnmbox-mbox-buffer |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
643 (let ((nnheader-file-coding-system |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
644 nnmbox-file-coding-system)) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
645 (nnheader-find-file-noselect |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
646 nnmbox-mbox-file t t)))) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
647 (mm-enable-multibyte) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
648 (buffer-disable-undo) |
17493 | 649 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
650 ;; Go through the group alist and compare against the mbox file. |
17493 | 651 (while alist |
652 (goto-char (point-max)) | |
653 (when (and (re-search-backward | |
654 (format "^X-Gnus-Newsgroup: %s:\\([0-9]+\\) " | |
655 (caar alist)) nil t) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
656 (> (setq number |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
657 (string-to-number |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
658 (buffer-substring |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
659 (match-beginning 1) (match-end 1)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
660 (cdadar alist))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
661 (setcdr (cadar alist) number)) |
17493 | 662 (setq alist (cdr alist))) |
663 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
664 ;; Examine all articles for our private X-Gnus-Newsgroup |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
665 ;; headers. This is done primarily as a consistency check, but |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
666 ;; it is convenient for building an index of the articles |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
667 ;; present, to avoid costly searches for missing articles |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
668 ;; (eg. when expiring articles). |
17493 | 669 (goto-char (point-min)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
670 (setq nnmbox-group-active-articles nil) |
17493 | 671 (while (re-search-forward delim nil t) |
672 (setq start (match-beginning 0)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
673 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
674 (search-forward "\n\n" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
675 (setq end-header (point)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
676 (setq end (or (and |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
677 (re-search-forward delim nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
678 (match-beginning 0)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
679 (point-max)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
680 (if (search-forward "\nX-Gnus-Newsgroup: " end-header t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
681 ;; Build a list of articles in each group, remembering |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
682 ;; that each article may be in more than one group. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
683 (progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
684 (nnmbox-record-active-article (nnmbox-article-group-number t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
685 (while (search-forward "\nX-Gnus-Newsgroup: " end-header t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
686 (nnmbox-record-active-article (nnmbox-article-group-number t)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
687 ;; The article is either new, or for some other reason |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
688 ;; hasn't got our private headers, so add them now. The |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
689 ;; only situation I've encountered when the X-Gnus-Newsgroup |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
690 ;; header is missing is if the article contains a forwarded |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
691 ;; message which does contain that header line (earlier |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
692 ;; versions of Gnus didn't restrict their search to the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
693 ;; headers). In this case, there is an Xref line which |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
694 ;; provides the relevant information to construct the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
695 ;; missing header(s). |
17493 | 696 (save-excursion |
697 (save-restriction | |
698 (narrow-to-region start end) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
699 (if (re-search-forward "\nXref: [^ ]+" end-header t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
700 ;; generate headers from Xref: |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
701 (let (alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
702 (while (re-search-forward " \\([^:]+\\):\\([0-9]+\\)" end-header t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
703 (push (cons (match-string 1) |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
704 (string-to-number (match-string 2))) alist)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
705 (nnmbox-insert-newsgroup-line alist)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
706 ;; this is really a new article |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
707 (nnmbox-save-mail |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
708 (nnmail-article-group 'nnmbox-active-number)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
709 (goto-char end)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
710 ;; put article lists in order |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
711 (setq alist nnmbox-group-active-articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
712 (while alist |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
713 (setcdr (car alist) (gnus-compress-sequence (nreverse (cdar alist)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
714 (setq alist (cdr alist))))))) |
17493 | 715 |
716 (provide 'nnmbox) | |
717 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
718 ;; arch-tag: 611dd95f-be37-413a-b3ae-8b059ba93659 |
17493 | 719 ;;; nnmbox.el ends here |