*** empty log message ***
[gnus] / lisp / nnml.el
1 ;;; nnml.el --- mail spool access for Gnus
2 ;; Copyright (C) 1995 Free Software Foundation, Inc.
3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
5 ;;      Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
6 ;; Keywords: news, mail
7
8 ;; This file is part of GNU Emacs.
9
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)
13 ;; any later version.
14
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.
19
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
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23
24 ;;; Commentary:
25
26 ;; Based on nnspool.el by Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>.
27 ;; For an overview of what the interface functions do, please see the
28 ;; Gnus sources.  
29
30 ;;; Code:
31
32 (require 'nnheader)
33 (require 'nnmail)
34
35 (defvar nnml-directory "~/Mail/"
36   "Mail directory.")
37
38 (defvar nnml-active-file (concat nnml-directory "active")
39   "Mail active file.")
40
41 (defvar nnml-newsgroups-file (concat nnml-directory "newsgroups")
42   "Mail newsgroups description file.")
43
44 (defvar nnml-get-new-mail t
45   "If non-nil, nnml will check the incoming mail file and split the mail.")
46
47 (defvar nnml-nov-is-evil nil
48   "If non-nil, Gnus will never generate and use nov databases for mail groups.
49 Using nov databases will speed up header fetching considerably.
50 This variable shouldn't be flipped much. If you have, for some reason,
51 set this to t, and want to set it to nil again, you should always run
52 the `nnml-generate-nov-databases' command. The function will go
53 through all nnml directories and generate nov databases for them
54 all. This may very well take some time.")
55
56 \f
57
58 (defconst nnml-version "nnml 0.2"
59   "nnml version.")
60
61 (defvar nnml-current-directory nil
62   "Current news group directory.")
63
64 (defvar nnml-status-string "")
65
66 (defvar nnml-nov-buffer-alist nil)
67
68 (defvar nnml-group-alist nil)
69 (defvar nnml-active-timestamp nil)
70
71 \f
72
73 ;; Server variables.
74
75 (defvar nnml-current-server nil)
76 (defvar nnml-server-alist nil)
77 (defvar nnml-server-variables 
78   (list 
79    (list 'nnml-directory nnml-directory)
80    (list 'nnml-active-file nnml-active-file)
81    (list 'nnml-newsgroups-file nnml-newsgroups-file)
82    (list 'nnml-get-new-mail nnml-get-new-mail)
83    (list 'nnml-nov-is-evil nnml-nov-is-evil)
84    '(nnml-current-directory nil)
85    '(nnml-status-string "")
86    '(nnml-nov-buffer-alist nil)
87    '(nnml-group-alist nil)
88    '(nnml-active-timestamp nil)))
89
90 \f
91
92 ;;; Interface functions.
93
94 (defun nnml-retrieve-headers (sequence &optional newsgroup server)
95   (save-excursion
96     (set-buffer nntp-server-buffer)
97     (erase-buffer)
98     (let ((file nil)
99           (number (length sequence))
100           (count 0)
101           beg article)
102       (nnml-possibly-change-directory newsgroup)
103       (if (nnml-retrieve-headers-with-nov sequence)
104           'nov
105         (while sequence
106           (setq article (car sequence))
107           (setq file
108                 (concat nnml-current-directory (prin1-to-string article)))
109           (if (and (file-exists-p file)
110                    (not (file-directory-p file)))
111               (progn
112                 (insert (format "221 %d Article retrieved.\n" article))
113                 (setq beg (point))
114                 (insert-file-contents file)
115                 (goto-char beg)
116                 (if (search-forward "\n\n" nil t)
117                     (forward-char -1)
118                   (goto-char (point-max))
119                   (insert "\n\n"))
120                 (insert ".\n")
121                 (delete-region (point) (point-max))))
122           (setq sequence (cdr sequence))
123           (setq count (1+ count))
124           (and (numberp nnmail-large-newsgroup)
125                (> number nnmail-large-newsgroup)
126                (zerop (% count 20))
127                gnus-verbose-backends
128                (message "nnml: Receiving headers... %d%%"
129                         (/ (* count 100) number))))
130
131         (and (numberp nnmail-large-newsgroup)
132              (> number nnmail-large-newsgroup)
133              gnus-verbose-backends
134              (message "nnml: Receiving headers... done"))
135
136         ;; Fold continuation lines.
137         (goto-char 1)
138         (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
139           (replace-match " " t t))
140         'headers))))
141
142 (defun nnml-open-server (server &optional defs)
143   (nnheader-init-server-buffer)
144   (if (equal server nnml-current-server)
145       t
146     (if nnml-current-server
147         (setq nnml-server-alist 
148               (cons (list nnml-current-server
149                           (nnheader-save-variables nnml-server-variables))
150                     nnml-server-alist)))
151     (let ((state (assoc server nnml-server-alist)))
152       (if state 
153           (progn
154             (nnheader-restore-variables (nth 1 state))
155             (setq nnml-server-alist (delq state nnml-server-alist)))
156         (nnheader-set-init-variables nnml-server-variables defs)))
157     (setq nnml-current-server server)))
158
159 (defun nnml-close-server (&optional server)
160   t)
161
162 (defun nnml-server-opened (&optional server)
163   (equal server nnml-current-server))
164
165 (defun nnml-status-message (&optional server)
166   nnml-status-string)
167
168 (defun nnml-request-article (id &optional newsgroup server buffer)
169   (nnml-possibly-change-directory newsgroup)
170   (let ((file (if (stringp id)
171                   nil
172                 (concat nnml-current-directory (prin1-to-string id))))
173         (nntp-server-buffer (or buffer nntp-server-buffer)))
174     (if (and (stringp file)
175              (file-exists-p file)
176              (not (file-directory-p file)))
177         (save-excursion
178           (nnmail-find-file file)))))
179
180 (defun nnml-request-group (group &optional server dont-check)
181   (if (not (nnml-possibly-change-directory group))
182       (progn
183         (setq nnml-status-string "Invalid group (no such directory)")
184         nil)
185     (if dont-check 
186         t
187       (nnml-get-new-mail)
188       (let ((timestamp (nth 5 (file-attributes nnml-active-file))))
189         (if (or (not nnml-active-timestamp)
190                 (> (nth 0 timestamp) (nth 0 nnml-active-timestamp))
191                 (> (nth 1 timestamp) (nth 1 nnml-active-timestamp)))
192             (progn
193               (setq nnml-active-timestamp timestamp)
194               (nnml-request-list)
195               (setq nnml-group-alist (nnmail-get-active))))
196         (let ((active (nth 1 (assoc group nnml-group-alist))))
197           (save-excursion
198             (set-buffer nntp-server-buffer)
199             (erase-buffer)
200             (if (not active)
201                 ()
202               (insert (format "211 %d %d %d %s\n" 
203                               (max (1+ (- (cdr active) (car active))) 0)
204                               (car active) (cdr active) group))
205               t)))))))
206
207 (defun nnml-close-group (group &optional server)
208   t)
209
210 (defun nnml-request-create-group (group &optional server) 
211   (nnml-request-list)
212   (setq nnml-group-alist (nnmail-get-active))
213   (or (assoc group nnml-group-alist)
214       (let (active)
215         (setq nnml-group-alist (cons (list group (setq active (cons 0 0)))
216                                      nnml-group-alist))
217         (nnml-possibly-create-directory group)
218         (nnml-possibly-change-directory group)
219         (let ((articles (mapcar
220                          (lambda (file)
221                            (int-to-string file))
222                          (directory-files 
223                           nnml-current-directory nil "^[0-9]+$"))))
224           (and articles
225                (progn
226                  (setcar active (apply 'min articles))
227                  (setcdr active (apply 'max articles)))))
228         (nnmail-save-active nnml-group-alist nnml-active-file)))
229   t)
230
231 (defun nnml-request-list (&optional server)
232   (if server (nnml-get-new-mail))
233   (save-excursion
234     (nnmail-find-file nnml-active-file)))
235
236 (defun nnml-request-newgroups (date &optional server)
237   (nnml-request-list server))
238
239 (defun nnml-request-list-newsgroups (&optional server)
240   (save-excursion
241     (nnmail-find-file nnml-newsgroups-file)))
242
243 (defun nnml-request-post (&optional server)
244   (mail-send-and-exit nil))
245
246 (fset 'nnml-request-post-buffer 'nnmail-request-post-buffer)
247
248 (defun nnml-request-expire-articles (articles newsgroup &optional server force)
249   (nnml-possibly-change-directory newsgroup)
250   (let* ((days (or (and nnmail-expiry-wait-function
251                         (funcall nnmail-expiry-wait-function newsgroup))
252                    nnmail-expiry-wait))
253          (active-articles 
254           (mapcar
255            (function
256             (lambda (name)
257               (string-to-int name)))
258            (directory-files nnml-current-directory nil "^[0-9]+$" t)))
259          (max-article (and active-articles (apply 'max active-articles)))
260          article rest mod-time)
261     (while articles
262       (setq article (concat nnml-current-directory (int-to-string
263                                                       (car articles))))
264       (if (setq mod-time (nth 5 (file-attributes article)))
265           (if (and (or (not nnmail-keep-last-article)
266                        (not max-article)
267                        (not (= (car articles) max-article)))
268                    (or force
269                        (> (nnmail-days-between
270                            (current-time-string)
271                            (current-time-string mod-time))
272                           days)))
273               (progn
274                 (and gnus-verbose-backends (message "Deleting %s..." article))
275                 (condition-case ()
276                     (delete-file article)
277                   (file-error nil))
278                 (setq active-articles (delq (car articles) active-articles))
279                 (nnml-nov-delete-article newsgroup (car articles)))
280             (setq rest (cons (car articles) rest))))
281       (setq articles (cdr articles)))
282     (let ((active (nth 1 (assoc newsgroup nnml-group-alist))))
283       (setcar active (or (and active-articles (apply 'min active-articles))
284                          0))
285       (nnmail-save-active nnml-group-alist nnml-active-file))
286     (nnml-save-nov)
287     rest))
288
289 (defun nnml-request-move-article 
290   (article group server accept-form &optional last)
291   (let ((buf (get-buffer-create " *nnml move*"))
292         result)
293     (and 
294      (nnml-request-article article group server)
295      (save-excursion
296        (set-buffer buf)
297        (insert-buffer-substring nntp-server-buffer)
298        (setq result (eval accept-form))
299        (kill-buffer (current-buffer))
300        result)
301      (progn
302        (condition-case ()
303            (delete-file (concat nnml-current-directory 
304                                 (int-to-string article)))
305          (file-error nil))
306        (nnml-nov-delete-article group article)
307        (and last (nnml-save-nov))))
308     result))
309
310 (defun nnml-request-accept-article (group &optional last)
311   (let (result)
312     (if (stringp group)
313         (and 
314          (nnml-request-list)
315          (setq nnml-group-alist (nnmail-get-active))
316          ;; We trick the choosing function into believing that only one
317          ;; group is availiable.  
318          (let ((nnmail-split-methods (list (list group ""))))
319            (setq result (car (nnml-save-mail))))
320          (progn
321            (nnmail-save-active nnml-group-alist nnml-active-file)
322            (and last (nnml-save-nov))))
323       (and
324        (nnml-request-list)
325        (setq nnml-group-alist (nnmail-get-active))
326        (setq result (car (nnml-save-mail)))
327        (progn
328          (nnmail-save-active nnml-group-alist nnml-active-file)
329          (and last (nnml-save-nov)))))
330     result))
331
332 (defun nnml-request-replace-article (article group buffer)
333   (nnml-possibly-change-directory group)
334   (save-excursion
335     (set-buffer buffer)
336     (nnml-possibly-create-directory group)
337     (if (not (condition-case ()
338                  (progn
339                    (write-region (point-min) (point-max)
340                                  (concat nnml-current-directory 
341                                          (int-to-string article))
342                                  nil (if gnus-verbose-backends nil 'nomesg))
343                    t)
344                (error nil)))
345         ()
346       (let ((chars (nnmail-insert-lines))
347             (art (concat (int-to-string article) "\t"))
348             nov-line)
349         (setq nov-line (nnml-make-nov-line chars))
350         (save-excursion 
351           (set-buffer (nnml-open-nov group))
352           (goto-char (point-min))
353           (if (or (looking-at art)
354                   (search-forward (concat "\n" art)))
355               (progn
356                 (delete-region (progn (beginning-of-line) (point))
357                                (progn (forward-line 1) (point)))
358                 (insert (int-to-string article) nov-line)
359                 (nnml-save-nov))
360             (kill-buffer (current-buffer)))
361           t)))))
362
363
364 \f
365 ;;; Internal functions
366
367 (defun nnml-retrieve-headers-with-nov (articles)
368   (if (or gnus-nov-is-evil nnml-nov-is-evil)
369       nil
370     (let ((first (car articles))
371           (last (progn (while (cdr articles) (setq articles (cdr articles)))
372                        (car articles)))
373           (nov (concat nnml-current-directory ".nov")))
374       (if (file-exists-p nov)
375           (save-excursion
376             (set-buffer nntp-server-buffer)
377             (erase-buffer)
378             (insert-file-contents nov)
379             (goto-char 1)
380             (while (and (not (eobp)) (< first (read (current-buffer))))
381               (forward-line 1))
382             (beginning-of-line)
383             (if (not (eobp)) (delete-region 1 (point)))
384             (while (and (not (eobp)) (>= last (read (current-buffer))))
385               (forward-line 1))
386             (beginning-of-line)
387             (if (not (eobp)) (delete-region (point) (point-max)))
388             t)))))
389
390 (defun nnml-possibly-change-directory (newsgroup &optional force)
391   (if newsgroup
392       (let ((pathname (nnmail-article-pathname newsgroup nnml-directory)))
393         (and (or force (file-directory-p pathname))
394              (setq nnml-current-directory pathname)))
395     t))
396
397 (defun nnml-possibly-create-directory (group)
398   (let (dir dirs)
399     (setq dir (nnmail-article-pathname group nnml-directory))
400     (while (not (file-directory-p dir))
401       (setq dirs (cons dir dirs))
402       (setq dir (file-name-directory (directory-file-name dir))))
403     (while dirs
404       (if (make-directory (directory-file-name (car dirs)))
405           (error "Could not create directory %s" (car dirs)))
406       (and gnus-verbose-backends 
407            (message "Creating mail directory %s" (car dirs)))
408       (setq dirs (cdr dirs)))))
409              
410 (defun nnml-save-mail ()
411   "Called narrowed to an article."
412   (let ((group-art (nreverse (nnmail-article-group 'nnml-active-number)))
413         chars nov-line)
414     (setq chars (nnmail-insert-lines))
415     (nnmail-insert-xref group-art)
416     (goto-char (point-min))
417     (while (looking-at "From ")
418       (replace-match "X-From-Line: ")
419       (forward-line 1))
420     ;; We save the article in all the newsgroups it belongs in.
421     (let ((ga group-art)
422           first)
423       (while ga
424         (nnml-possibly-create-directory (car (car ga)))
425         (let ((file (concat (nnmail-article-pathname 
426                              (car (car ga)) nnml-directory)
427                             (int-to-string (cdr (car ga))))))
428           (if first
429               ;; It was already saved, so we just make a hard link.
430               (add-name-to-file first file t)
431             ;; Save the article.
432             (write-region (point-min) (point-max) file nil 
433                           (if gnus-verbose-backends nil 'nomesg))
434             (setq first file)))
435         (setq ga (cdr ga))))
436     ;; Generate a nov line for this article. We generate the nov
437     ;; line after saving, because nov generation destroys the
438     ;; header. 
439     (setq nov-line (nnml-make-nov-line chars))
440     ;; Output the nov line to all nov databases that should have it.
441     (let ((ga group-art))
442       (while ga
443         (nnml-add-nov (car (car ga)) (cdr (car ga)) nov-line)
444         (setq ga (cdr ga))))
445     group-art))
446
447 (defun nnml-active-number (group)
448   "Compute the next article number in GROUP."
449   (let ((active (car (cdr (assoc group nnml-group-alist)))))
450     (or active
451         (progn
452           (setq active (cons 1 0))
453           (setq nnml-group-alist (cons (list group active) nnml-group-alist))))
454     (setcdr active (1+ (cdr active)))
455     (let (file)
456       (while (file-exists-p
457               (setq file (concat (nnmail-article-pathname 
458                                   group nnml-directory)
459                                  (int-to-string (cdr active)))))
460         (setcdr active (1+ (cdr active)))))
461     (cdr active)))
462
463 (defun nnml-get-new-mail ()
464   "Read new incoming mail."
465   (let (incoming)
466     (if (and nnml-get-new-mail nnmail-spool-file
467              (file-exists-p nnmail-spool-file)
468              (> (nth 7 (file-attributes nnmail-spool-file)) 0))
469         (progn
470           (and gnus-verbose-backends 
471                (message "nnml: Reading incoming mail..."))
472           (setq incoming 
473                 (nnmail-move-inbox nnmail-spool-file 
474                                    (concat nnml-directory "Incoming")))
475           (nnml-request-list)
476           (setq nnml-group-alist (nnmail-get-active))
477           (nnmail-split-incoming incoming 'nnml-save-mail)
478           (nnmail-save-active nnml-group-alist nnml-active-file)
479           (nnml-save-nov)
480           (run-hooks 'nnmail-read-incoming-hook)
481           ;; The following has been commented away, just to make sure
482           ;; that nobody ever loses any mail. If you feel safe that
483           ;; nnml will never do anything strange, just remove those
484           ;; two semicolons, and avoid having lots of "Incoming*"
485           ;; files. 
486 ;;         (delete-file incoming)
487           (and gnus-verbose-backends
488                (message "nnml: Reading incoming mail...done"))))))
489
490
491 (defun nnml-add-nov (group article line)
492   "Add a nov line for the GROUP base."
493   (save-excursion 
494     (set-buffer (nnml-open-nov group))
495     (goto-char (point-max))
496     (insert (int-to-string article) line)))
497
498 (defsubst nnml-header-value ()
499   (buffer-substring (match-end 0) (save-excursion (end-of-line) (point))))
500
501 (defun nnml-make-nov-line (chars)
502   "Create a nov from the current headers."
503   (let ((case-fold-search t)
504         subject from date id references lines xref in-reply-to char)
505     (save-excursion
506       (save-restriction
507         (goto-char (point-min))
508         (narrow-to-region 
509          (point)
510          (1- (or (search-forward "\n\n" nil t) (point-max))))
511         ;; Fold continuation lines.
512         (goto-char (point-min))
513         (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
514           (replace-match " " t t))
515         (subst-char-in-region (point-min) (point-max) ?\t ? )
516         ;; [number subject from date id references chars lines xref]
517         (save-excursion
518           (goto-char (point-min))
519           (while (re-search-forward "^\\(from\\|subject\\|message-id\\|date\\|lines\\|xref\\|references\\|in-reply-to\\): "
520                                     nil t)
521             (beginning-of-line)
522             (setq char (downcase (following-char))) 
523             (cond
524              ((eq char ?s)
525               (setq subject (nnml-header-value)))
526              ((eq char ?f)
527               (setq from (nnml-header-value)))
528              ((eq char ?x)
529               (setq xref (nnml-header-value)))
530              ((eq char ?l)
531               (setq lines (nnml-header-value)))
532              ((eq char ?d)
533               (setq date (nnml-header-value)))
534              ((eq char ?m)
535               (setq id (setq id (nnml-header-value))))
536              ((eq char ?r)
537               (setq references (nnml-header-value)))
538              ((eq char ?i)
539               (setq in-reply-to (nnml-header-value))))
540             (forward-line 1))
541       
542           (and (not references)
543                in-reply-to
544                (string-match "<[^>]+>" in-reply-to)
545                (setq references
546                      (substring in-reply-to (match-beginning 0)
547                                 (match-end 0)))))
548         ;; [number subject from date id references chars lines xref]
549         (format "\t%s\t%s\t%s\t%s\t%s\t%d\t%s\t%s\t\n"
550                 (or subject "(none)")
551                 (or from "(nobody)") (or date "")
552                 (or id (concat "nnml-dummy-id-" 
553                                (mapconcat 
554                                 (lambda (time) (int-to-string time))
555                                 (current-time) "-")))
556                 (or references "")
557                 (or chars 0) (or lines "0") (or xref ""))))))
558
559 (defun nnml-open-nov (group)
560   (or (cdr (assoc group nnml-nov-buffer-alist))
561       (let ((buffer (find-file-noselect 
562                      (concat (nnmail-article-pathname 
563                               group nnml-directory) ".nov"))))
564         (save-excursion
565           (set-buffer buffer)
566           (buffer-disable-undo (current-buffer)))
567         (setq nnml-nov-buffer-alist 
568               (cons (cons group buffer) nnml-nov-buffer-alist))
569         buffer)))
570
571 (defun nnml-save-nov ()
572   (save-excursion
573     (while nnml-nov-buffer-alist
574       (if (buffer-name (cdr (car nnml-nov-buffer-alist)))
575           (progn
576             (set-buffer (cdr (car nnml-nov-buffer-alist)))
577             (and (buffer-modified-p)
578                  (write-region 
579                   1 (point-max) (buffer-file-name) nil 'nomesg))
580             (set-buffer-modified-p nil)
581             (kill-buffer (current-buffer))))
582       (setq nnml-nov-buffer-alist (cdr nnml-nov-buffer-alist)))))
583
584 ;;;###autoload
585 (defun nnml-generate-nov-databases (dir)
586   "Generate nov databases in all nnml mail newsgroups."
587   (interactive 
588    (progn   
589      (setq nnml-group-alist nil)
590      (list nnml-directory)))
591   (nnml-open-server (system-name))
592   (let ((dirs (directory-files dir t nil t)))
593     (while dirs 
594       (if (and (not (string-match "/\\.\\.$" (car dirs)))
595                (not (string-match "/\\.$" (car dirs)))
596                (file-directory-p (car dirs)))
597           (nnml-generate-nov-databases (car dirs)))
598       (setq dirs (cdr dirs))))
599   (let ((files (sort
600                 (mapcar
601                  (function
602                   (lambda (name)
603                     (string-to-int name)))
604                  (directory-files dir nil "^[0-9]+$" t))
605                 (function <)))
606         (nov (concat dir "/.nov"))
607         (nov-buffer (get-buffer-create "*nov*"))
608         nov-line chars)
609     (if files
610         (setq nnml-group-alist 
611               (cons (list (nnmail-replace-chars-in-string 
612                            (substring (expand-file-name dir)
613                                       (length (expand-file-name 
614                                                nnml-directory)))
615                            ?/ ?.)
616                           (cons (car files)
617                                 (let ((f files))
618                                   (while (cdr f) (setq f (cdr f)))
619                                   (car f))))
620                     nnml-group-alist)))
621     (if files
622         (save-excursion
623           (set-buffer nntp-server-buffer)
624           (if (file-exists-p nov)
625               (delete-file nov))
626           (save-excursion
627             (set-buffer nov-buffer)
628             (buffer-disable-undo (current-buffer))
629             (erase-buffer))
630           (while files
631             (erase-buffer)
632             (insert-file-contents (concat dir "/" (int-to-string (car files))))
633             (goto-char 1)
634             (narrow-to-region 1 (save-excursion (search-forward "\n\n" nil t)
635                                                 (setq chars (- (point-max) 
636                                                                (point)))
637                                                 (point)))
638             (if (not (= 0 chars)) ; none of them empty files...
639                 (progn
640                   (setq nov-line (nnml-make-nov-line chars))
641                   (save-excursion
642                     (set-buffer nov-buffer)
643                     (goto-char (point-max))
644                     (insert (int-to-string (car files)) nov-line))))
645             (widen)
646             (setq files (cdr files)))
647           (save-excursion
648             (set-buffer nov-buffer)
649             (write-region 1 (point-max) (expand-file-name nov) nil
650                           'nomesg)
651             (kill-buffer (current-buffer)))))
652     (nnmail-save-active nnml-group-alist nnml-active-file)))
653
654 (defun nnml-nov-delete-article (group article)
655   (save-excursion
656     (set-buffer (nnml-open-nov group))
657     (goto-char 1)
658     (if (re-search-forward (concat "^" (int-to-string article) "\t"))
659         (delete-region (match-beginning 0) (progn (forward-line 1) (point))))
660     t))
661
662 (provide 'nnml)
663
664 ;;; nnml.el ends here