1 ;;; nnml.el --- mail spool access for Gnus
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
5 ;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
6 ;; Keywords: news, mail
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; Based on nnspool.el by Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>.
28 ;; For an overview of what the interface functions do, please see the
40 (defvoo nnml-directory message-directory
41 "Mail spool directory.")
43 (defvoo nnml-active-file
44 (concat (file-name-as-directory nnml-directory
) "active")
47 (defvoo nnml-newsgroups-file
48 (concat (file-name-as-directory nnml-directory
) "newsgroups")
49 "Mail newsgroups description file.")
51 (defvoo nnml-get-new-mail t
52 "If non-nil, nnml will check the incoming mail file and split the mail.")
54 (defvoo nnml-nov-is-evil nil
55 "If non-nil, Gnus will never generate and use nov databases for mail groups.
56 Using nov databases will speed up header fetching considerably.
57 This variable shouldn't be flipped much. If you have, for some reason,
58 set this to t, and want to set it to nil again, you should always run
59 the `nnml-generate-nov-databases' command. The function will go
60 through all nnml directories and generate nov databases for them
61 all. This may very well take some time.")
63 (defvoo nnml-prepare-save-mail-hook nil
64 "Hook run narrowed to an article before saving.")
66 (defvoo nnml-inhibit-expiry nil
67 "If non-nil, inhibit expiry.")
72 (defconst nnml-version
"nnml 1.0"
75 (defvoo nnml-nov-file-name
".overview")
77 (defvoo nnml-current-directory nil
)
78 (defvoo nnml-current-group nil
)
79 (defvoo nnml-status-string
"")
80 (defvoo nnml-nov-buffer-alist nil
)
81 (defvoo nnml-group-alist nil
)
82 (defvoo nnml-active-timestamp nil
)
83 (defvoo nnml-article-file-alist nil
)
85 (defvoo nnml-generate-active-function
'nnml-generate-active-info
)
89 ;;; Interface functions.
91 (nnoo-define-basics nnml
)
93 (deffoo nnml-retrieve-headers
(sequence &optional newsgroup server fetch-old
)
95 (set-buffer nntp-server-buffer
)
98 (number (length sequence
))
101 (if (stringp (car sequence
))
103 (nnml-possibly-change-directory newsgroup server
)
104 (unless nnml-article-file-alist
105 (setq nnml-article-file-alist
106 (nnheader-article-to-file-alist nnml-current-directory
)))
107 (if (nnml-retrieve-headers-with-nov sequence fetch-old
)
110 (setq article
(car sequence
))
112 (concat nnml-current-directory
113 (or (cdr (assq article nnml-article-file-alist
))
115 (if (and (file-exists-p file
)
116 (not (file-directory-p file
)))
118 (insert (format "221 %d Article retrieved.\n" article
))
120 (nnheader-insert-head file
)
122 (if (search-forward "\n\n" nil t
)
124 (goto-char (point-max))
127 (delete-region (point) (point-max))))
128 (setq sequence
(cdr sequence
))
129 (setq count
(1+ count
))
130 (and (numberp nnmail-large-newsgroup
)
131 (> number nnmail-large-newsgroup
)
133 (nnheader-message 6 "nnml: Receiving headers... %d%%"
134 (/ (* count
100) number
))))
136 (and (numberp nnmail-large-newsgroup
)
137 (> number nnmail-large-newsgroup
)
138 (nnheader-message 6 "nnml: Receiving headers...done"))
140 (nnheader-fold-continuation-lines)
143 (deffoo nnml-open-server
(server &optional defs
)
144 (nnoo-change-server 'nnml server defs
)
145 (when (not (file-exists-p nnml-directory
))
147 (make-directory nnml-directory t
)
150 ((not (file-exists-p nnml-directory
))
152 (nnheader-report 'nnml
"Couldn't create directory: %s" nnml-directory
))
153 ((not (file-directory-p (file-truename nnml-directory
)))
155 (nnheader-report 'nnml
"Not a directory: %s" nnml-directory
))
157 (nnheader-report 'nnml
"Opened server %s using directory %s"
158 server nnml-directory
)
161 (deffoo nnml-request-article
(id &optional newsgroup server buffer
)
162 (nnml-possibly-change-directory newsgroup server
)
163 (let* ((nntp-server-buffer (or buffer nntp-server-buffer
))
164 file path gpath group-num
)
166 (when (and (setq group-num
(nnml-find-group-number id
))
168 (assq (cdr group-num
)
169 (nnheader-article-to-file-alist
171 (nnmail-group-pathname
173 nnml-directory
)))))))
174 (setq path
(concat gpath
(int-to-string (cdr group-num
)))))
175 (unless nnml-article-file-alist
176 (setq nnml-article-file-alist
177 (nnheader-article-to-file-alist nnml-current-directory
)))
178 (when (setq file
(cdr (assq id nnml-article-file-alist
)))
179 (setq path
(concat nnml-current-directory file
))))
182 (nnheader-report 'nnml
"No such article: %s" id
))
183 ((not (file-exists-p path
))
184 (nnheader-report 'nnml
"No such file: %s" path
))
185 ((file-directory-p path
)
186 (nnheader-report 'nnml
"File is a directory: %s" path
))
187 ((not (save-excursion (nnmail-find-file path
)))
188 (nnheader-report 'nnml
"Couldn't read file: %s" path
))
190 (nnheader-report 'nnml
"Article %s retrieved" id
)
191 ;; We return the article number.
192 (cons newsgroup
(string-to-int (file-name-nondirectory path
)))))))
194 (deffoo nnml-request-group
(group &optional server dont-check
)
196 ((not (nnml-possibly-change-directory group server
))
197 (nnheader-report 'nnml
"Invalid group (no such directory)"))
198 ((not (file-directory-p nnml-current-directory
))
199 (nnheader-report 'nnml
"%s is not a directory" nnml-current-directory
))
201 (nnheader-report 'nnml
"Group %s selected" group
)
204 (nnmail-activate 'nnml
)
205 (let ((active (nth 1 (assoc group nnml-group-alist
))))
207 (nnheader-report 'nnml
"No such group: %s" group
)
208 (nnheader-report 'nnml
"Selected group %s" group
)
209 (nnheader-insert "211 %d %d %d %s\n"
210 (max (1+ (- (cdr active
) (car active
))) 0)
211 (car active
) (cdr active
) group
))))))
213 (deffoo nnml-request-scan
(&optional group server
)
214 (setq nnml-article-file-alist nil
)
215 (nnmail-get-new-mail 'nnml
'nnml-save-nov nnml-directory group
))
217 (deffoo nnml-close-group
(group &optional server
)
218 (setq nnml-article-file-alist nil
)
221 (deffoo nnml-request-create-group
(group &optional server
)
222 (nnmail-activate 'nnml
)
223 (or (assoc group nnml-group-alist
)
225 (setq nnml-group-alist
(cons (list group
(setq active
(cons 1 0)))
227 (nnml-possibly-create-directory group
)
228 (nnml-possibly-change-directory group server
)
230 (nnheader-directory-articles nnml-current-directory
)))
233 (setcar active
(apply 'min articles
))
234 (setcdr active
(apply 'max articles
)))))
235 (nnmail-save-active nnml-group-alist nnml-active-file
)))
238 (deffoo nnml-request-list
(&optional server
)
240 (nnmail-find-file nnml-active-file
)
241 (setq nnml-group-alist
(nnmail-get-active))))
243 (deffoo nnml-request-newgroups
(date &optional server
)
244 (nnml-request-list server
))
246 (deffoo nnml-request-list-newsgroups
(&optional server
)
248 (nnmail-find-file nnml-newsgroups-file
)))
250 (deffoo nnml-request-expire-articles
(articles newsgroup
&optional server force
)
251 (nnml-possibly-change-directory newsgroup server
)
252 (let* ((active-articles
253 (nnheader-directory-articles nnml-current-directory
))
255 article rest mod-time number
)
256 (nnmail-activate 'nnml
)
258 (unless nnml-article-file-alist
259 (setq nnml-article-file-alist
260 (nnheader-article-to-file-alist nnml-current-directory
)))
262 (while (and articles is-old
)
263 (setq article
(concat nnml-current-directory
265 (setq number
(pop articles
)))))
266 (when (setq mod-time
(nth 5 (file-attributes article
)))
267 (if (and (nnml-deletable-article-p newsgroup number
)
269 (nnmail-expired-article-p newsgroup mod-time force
270 nnml-inhibit-expiry
)))
272 (nnheader-message 5 "Deleting article %s in %s..."
275 (funcall nnmail-delete-file-function article
)
278 (setq active-articles
(delq number active-articles
))
279 (nnml-nov-delete-article newsgroup number
))
280 (push number rest
))))
281 (let ((active (nth 1 (assoc newsgroup nnml-group-alist
))))
283 (setcar active
(or (and active-articles
284 (apply 'min active-articles
))
286 (nnmail-save-active nnml-group-alist nnml-active-file
))
289 (nconc rest articles
)))
291 (deffoo nnml-request-move-article
292 (article group server accept-form
&optional last
)
293 (let ((buf (get-buffer-create " *nnml move*"))
295 (nnml-possibly-change-directory group server
)
296 (unless nnml-article-file-alist
297 (setq nnml-article-file-alist
298 (nnheader-article-to-file-alist nnml-current-directory
)))
300 (nnml-deletable-article-p group article
)
301 (nnml-request-article article group server
)
304 (insert-buffer-substring nntp-server-buffer
)
305 (setq result
(eval accept-form
))
306 (kill-buffer (current-buffer))
309 (nnml-possibly-change-directory group server
)
311 (funcall nnmail-delete-file-function
312 (concat nnml-current-directory
313 (int-to-string article
)))
315 (nnml-nov-delete-article group article
)
316 (and last
(nnml-save-nov))))
319 (deffoo nnml-request-accept-article
(group &optional server last
)
320 (nnml-possibly-change-directory group server
)
321 (nnmail-check-syntax)
325 (nnmail-activate 'nnml
)
326 ;; We trick the choosing function into believing that only one
327 ;; group is available.
328 (let ((nnmail-split-methods (list (list group
""))))
329 (setq result
(car (nnml-save-mail))))
331 (nnmail-save-active nnml-group-alist nnml-active-file
)
332 (and last
(nnml-save-nov))))
334 (nnmail-activate 'nnml
)
335 (setq result
(car (nnml-save-mail)))
337 (nnmail-save-active nnml-group-alist nnml-active-file
)
338 (and last
(nnml-save-nov)))))
341 (deffoo nnml-request-replace-article
(article group buffer
)
342 (nnml-possibly-change-directory group
)
345 (nnml-possibly-create-directory group
)
346 (let ((chars (nnmail-insert-lines))
347 (art (concat (int-to-string article
) "\t"))
349 (when (condition-case ()
352 (point-min) (point-max)
353 (concat nnml-current-directory
(int-to-string article
))
354 nil
(if (nnheader-be-verbose 5) nil
'nomesg
))
357 (setq headers
(nnml-parse-head chars article
))
358 ;; Replace the NOV line in the NOV file.
360 (set-buffer (nnml-open-nov group
))
361 (goto-char (point-min))
362 (if (or (looking-at art
)
363 (search-forward (concat "\n" art
) nil t
))
364 ;; Delete the old NOV line.
365 (delete-region (progn (beginning-of-line) (point))
366 (progn (forward-line 1) (point)))
367 ;; The line isn't here, so we have to find out where
368 ;; we should insert it. (This situation should never
369 ;; occur, but one likes to make sure...)
370 (while (and (looking-at "[0-9]+\t")
373 (match-beginning 0) (match-end 0)))
375 (zerop (forward-line 1)))))
377 (nnheader-insert-nov headers
)
381 (deffoo nnml-request-delete-group
(group &optional force server
)
382 (nnml-possibly-change-directory group server
)
384 ;; Delete all articles in GROUP.
387 nnml-current-directory t
388 (concat nnheader-numerical-short-files
389 "\\|" (regexp-quote nnml-nov-file-name
) "$")))
392 (setq article
(pop articles
))
393 (when (file-writable-p article
)
394 (nnheader-message 5 "Deleting article %s in %s..." article group
)
395 (funcall nnmail-delete-file-function article
))))
396 ;; Try to delete the directory itself.
398 (delete-directory nnml-current-directory
)
400 ;; Remove the group from all structures.
401 (setq nnml-group-alist
402 (delq (assoc group nnml-group-alist
) nnml-group-alist
)
403 nnml-current-group nil
404 nnml-current-directory nil
)
405 ;; Save the active file.
406 (nnmail-save-active nnml-group-alist nnml-active-file
)
409 (deffoo nnml-request-rename-group
(group new-name
&optional server
)
410 (nnml-possibly-change-directory group server
)
412 (and (file-writable-p nnml-current-directory
)
417 (nnmail-group-pathname new-name nnml-directory
)))))
418 (unless (file-exists-p parent
)
419 (make-directory parent t
))
421 (directory-file-name nnml-current-directory
)
423 (nnmail-group-pathname new-name nnml-directory
)))
426 ;; That went ok, so we change the internal structures.
427 (let ((entry (assoc group nnml-group-alist
)))
428 (and entry
(setcar entry new-name
))
429 (setq nnml-current-directory nil
430 nnml-current-group nil
)
431 ;; Save the new group alist.
432 (nnmail-save-active nnml-group-alist nnml-active-file
)
436 ;;; Internal functions.
438 (defun nnml-deletable-article-p (group article
)
439 "Say whether ARTICLE in GROUP can be deleted."
441 (when (setq file
(cdr (assq article nnml-article-file-alist
)))
442 (setq path
(concat nnml-current-directory file
))
443 (and (file-writable-p path
)
444 (or (not nnmail-keep-last-article
)
445 (not (eq (cdr (nth 1 (assoc group nnml-group-alist
)))
448 ;; Find an article number in the current group given the Message-ID.
449 (defun nnml-find-group-number (id)
451 (set-buffer (get-buffer-create " *nnml id*"))
452 (buffer-disable-undo (current-buffer))
453 (let ((alist nnml-group-alist
)
455 ;; We want to look through all .overview files, but we want to
456 ;; start with the one in the current directory. It seems most
457 ;; likely that the article we are looking for is in that group.
458 (if (setq number
(nnml-find-id nnml-current-group id
))
459 (cons nnml-current-group number
)
460 ;; It wasn't there, so we look through the other groups as well.
461 (while (and (not number
)
463 (or (string= (caar alist
) nnml-current-group
)
464 (setq number
(nnml-find-id (caar alist
) id
)))
466 (setq alist
(cdr alist
))))
468 (cons (caar alist
) number
))))))
470 (defun nnml-find-id (group id
)
472 (let ((nov (concat (nnmail-group-pathname group nnml-directory
)
475 (when (file-exists-p nov
)
476 (insert-file-contents nov
)
477 (while (and (not found
)
478 (search-forward id nil t
)) ; We find the ID.
479 ;; And the id is in the fourth field.
481 "\t" (save-excursion (beginning-of-line) (point)) t
4)
485 ;; We return the article number.
488 (read (current-buffer))
492 (defun nnml-retrieve-headers-with-nov (articles &optional fetch-old
)
493 (if (or gnus-nov-is-evil nnml-nov-is-evil
)
495 (let ((first (car articles
))
496 (last (progn (while (cdr articles
) (setq articles
(cdr articles
)))
498 (nov (concat nnml-current-directory nnml-nov-file-name
)))
499 (when (file-exists-p nov
)
501 (set-buffer nntp-server-buffer
)
503 (insert-file-contents nov
)
505 (not (numberp fetch-old
)))
506 t
; Don't remove anything.
508 (setq first
(max 1 (- first fetch-old
))))
509 (goto-char (point-min))
510 (while (and (not (eobp)) (> first
(read (current-buffer))))
513 (if (not (eobp)) (delete-region 1 (point)))
514 (while (and (not (eobp)) (>= last
(read (current-buffer))))
517 (if (not (eobp)) (delete-region (point) (point-max)))
520 (defun nnml-possibly-change-directory (group &optional server
)
522 (not (nnml-server-opened server
)))
523 (nnml-open-server server
))
525 (let ((pathname (nnmail-group-pathname group nnml-directory
)))
526 (when (not (equal pathname nnml-current-directory
))
527 (setq nnml-current-directory pathname
528 nnml-current-group group
529 nnml-article-file-alist nil
))))
532 (defun nnml-possibly-create-directory (group)
534 (setq dir
(nnmail-group-pathname group nnml-directory
))
535 (while (not (file-directory-p dir
))
536 (setq dirs
(cons dir dirs
))
537 (setq dir
(file-name-directory (directory-file-name dir
))))
539 (make-directory (directory-file-name (car dirs
)))
540 (nnheader-message 5 "Creating mail directory %s" (car dirs
))
541 (setq dirs
(cdr dirs
)))))
543 (defun nnml-save-mail ()
544 "Called narrowed to an article."
545 (let ((group-art (nreverse (nnmail-article-group 'nnml-active-number
)))
547 (setq chars
(nnmail-insert-lines))
548 (nnmail-insert-xref group-art
)
549 (run-hooks 'nnmail-prepare-save-mail-hook
)
550 (run-hooks 'nnml-prepare-save-mail-hook
)
551 (goto-char (point-min))
552 (while (looking-at "From ")
553 (replace-match "X-From-Line: ")
555 ;; We save the article in all the newsgroups it belongs in.
559 (nnml-possibly-create-directory (caar ga
))
560 (let ((file (concat (nnmail-group-pathname
561 (caar ga
) nnml-directory
)
562 (int-to-string (cdar ga
)))))
564 ;; It was already saved, so we just make a hard link.
565 (funcall nnmail-crosspost-link-function first file t
)
567 (write-region (point-min) (point-max) file nil
568 (if (nnheader-be-verbose 5) nil
'nomesg
))
571 ;; Generate a nov line for this article. We generate the nov
572 ;; line after saving, because nov generation destroys the
574 (setq headers
(nnml-parse-head chars
))
575 ;; Output the nov line to all nov databases that should have it.
576 (let ((ga group-art
))
578 (nnml-add-nov (caar ga
) (cdar ga
) headers
)
582 (defun nnml-active-number (group)
583 "Compute the next article number in GROUP."
584 (let ((active (cadr (assoc group nnml-group-alist
))))
585 ;; The group wasn't known to nnml, so we just create an active
588 ;; Perhaps the active file was corrupt? See whether
589 ;; there are any articles in this group.
590 (nnml-possibly-create-directory group
)
591 (nnml-possibly-change-directory group
)
592 (unless nnml-article-file-alist
593 (setq nnml-article-file-alist
595 (nnheader-article-to-file-alist nnml-current-directory
)
596 (lambda (a1 a2
) (< (car a1
) (car a2
))))))
598 (if nnml-article-file-alist
599 (cons (caar nnml-article-file-alist
)
600 (caar (last nnml-article-file-alist
)))
602 (setq nnml-group-alist
(cons (list group active
) nnml-group-alist
)))
603 (setcdr active
(1+ (cdr active
)))
604 (while (file-exists-p
605 (concat (nnmail-group-pathname group nnml-directory
)
606 (int-to-string (cdr active
))))
607 (setcdr active
(1+ (cdr active
))))
610 (defun nnml-add-nov (group article headers
)
611 "Add a nov line for the GROUP base."
613 (set-buffer (nnml-open-nov group
))
614 (goto-char (point-max))
615 (mail-header-set-number headers article
)
616 (nnheader-insert-nov headers
)))
618 (defsubst nnml-header-value
()
619 (buffer-substring (match-end 0) (progn (end-of-line) (point))))
621 (defun nnml-parse-head (chars &optional number
)
622 "Parse the head of the current buffer."
625 (goto-char (point-min))
628 (1- (or (search-forward "\n\n" nil t
) (point-max))))
629 ;; Fold continuation lines.
630 (goto-char (point-min))
631 (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t
)
632 (replace-match " " t t
))
633 ;; Remove any tabs; they are too confusing.
634 (subst-char-in-region (point-min) (point-max) ?
\t ?
)
635 (let ((headers (nnheader-parse-head t
)))
636 (mail-header-set-chars headers chars
)
637 (mail-header-set-number headers number
)
640 (defun nnml-open-nov (group)
641 (or (cdr (assoc group nnml-nov-buffer-alist
))
642 (let ((buffer (find-file-noselect
643 (concat (nnmail-group-pathname group nnml-directory
)
644 nnml-nov-file-name
))))
647 (buffer-disable-undo (current-buffer)))
648 (setq nnml-nov-buffer-alist
649 (cons (cons group buffer
) nnml-nov-buffer-alist
))
652 (defun nnml-save-nov ()
654 (while nnml-nov-buffer-alist
655 (when (buffer-name (cdar nnml-nov-buffer-alist
))
656 (set-buffer (cdar nnml-nov-buffer-alist
))
657 (and (buffer-modified-p)
659 1 (point-max) (buffer-file-name) nil
'nomesg
))
660 (set-buffer-modified-p nil
)
661 (kill-buffer (current-buffer)))
662 (setq nnml-nov-buffer-alist
(cdr nnml-nov-buffer-alist
)))))
665 (defun nnml-generate-nov-databases ()
666 "Generate nov databases in all nnml directories."
668 ;; Read the active file to make sure we don't re-use articles
669 ;; numbers in empty groups.
670 (nnmail-activate 'nnml
)
671 (nnml-open-server (or (nnoo-current-server 'nnml
) ""))
672 (setq nnml-directory
(expand-file-name nnml-directory
))
673 ;; Recurse down the directories.
674 (nnml-generate-nov-databases-1 nnml-directory
)
675 ;; Save the active file.
676 (nnmail-save-active nnml-group-alist nnml-active-file
))
678 (defun nnml-generate-nov-databases-1 (dir)
679 (setq dir
(file-name-as-directory dir
))
680 ;; We descend recursively
681 (let ((dirs (directory-files dir t nil t
))
684 (setq dir
(pop dirs
))
685 (when (and (not (member (file-name-nondirectory dir
) '("." "..")))
686 (file-directory-p dir
))
687 (nnml-generate-nov-databases-1 dir
))))
688 ;; Do this directory.
691 (lambda (name) (string-to-int name
))
692 (directory-files dir nil
"^[0-9]+$" t
))
695 (funcall nnml-generate-active-function dir
)
696 ;; Generate the nov file.
697 (nnml-generate-nov-file dir files
))))
700 (defun nnml-generate-active-info (dir)
701 ;; Update the active info for this group.
702 (let ((group (nnheader-file-to-group
703 (directory-file-name dir
) nnml-directory
)))
704 (setq nnml-group-alist
705 (delq (assoc group nnml-group-alist
) nnml-group-alist
))
709 (while (cdr f
) (setq f
(cdr f
)))
713 (defun nnml-generate-nov-file (dir files
)
714 (let* ((dir (file-name-as-directory dir
))
715 (nov (concat dir nnml-nov-file-name
))
716 (nov-buffer (get-buffer-create " *nov*"))
717 nov-line chars file headers
)
719 ;; Init the nov buffer.
720 (set-buffer nov-buffer
)
721 (buffer-disable-undo (current-buffer))
723 (set-buffer nntp-server-buffer
)
724 ;; Delete the old NOV file.
725 (when (file-exists-p nov
)
726 (funcall nnmail-delete-file-function nov
))
728 (unless (file-directory-p
729 (setq file
(concat dir
(int-to-string (car files
)))))
731 (insert-file-contents file
)
733 (goto-char (point-min))
735 (search-forward "\n\n" nil t
)
736 (setq chars
(- (point-max) (point)))
737 (max 1 (1- (point)))))
738 (when (and (not (= 0 chars
)) ; none of them empty files...
739 (not (= (point-min) (point-max))))
740 (goto-char (point-min))
741 (setq headers
(nnml-parse-head chars
(car files
)))
743 (set-buffer nov-buffer
)
744 (goto-char (point-max))
745 (nnheader-insert-nov headers
)))
747 (setq files
(cdr files
)))
749 (set-buffer nov-buffer
)
750 (write-region 1 (point-max) (expand-file-name nov
) nil
752 (kill-buffer (current-buffer))))))
754 (defun nnml-nov-delete-article (group article
)
756 (set-buffer (nnml-open-nov group
))
757 (goto-char (point-min))
758 (if (re-search-forward (concat "^" (int-to-string article
) "\t") nil t
)
759 (delete-region (match-beginning 0) (progn (forward-line 1) (point))))
764 ;;; nnml.el ends here