;;; nnml.el --- mail spool access for Gnus
-;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
;; Keywords: news, mail
(deffoo nnml-request-article (id &optional group server buffer)
(nnml-possibly-change-directory group server)
(let* ((nntp-server-buffer (or buffer nntp-server-buffer))
- ;; 1997/8/12 by MORIOKA Tomohiko
- ;; for XEmacs/mule.
(pathname-coding-system 'binary)
path gpath group-num)
(if (stringp id)
(deffoo nnml-request-create-group (group &optional server args)
(nnmail-activate 'nnml)
- (unless (assoc group nnml-group-alist)
+ (cond
+ ((assoc group nnml-group-alist)
+ t)
+ ((and (file-exists-p (nnmail-group-pathname group nnml-directory))
+ (not (file-directory-p (nnmail-group-pathname group nnml-directory))))
+ (nnheader-report 'nnml "%s is a file"
+ (nnmail-group-pathname group nnml-directory)))
+ (t
(let (active)
(push (list group (setq active (cons 1 0)))
nnml-group-alist)
(when articles
(setcar active (apply 'min articles))
(setcdr active (apply 'max articles))))
- (nnmail-save-active nnml-group-alist nnml-active-file)))
- t)
+ (nnmail-save-active nnml-group-alist nnml-active-file)
+ t))))
(deffoo nnml-request-list (&optional server)
(save-excursion
- ;; 1997/8/12 by MORIOKA Tomohiko
- ;; for XEmacs/mule.
(let ((nnmail-file-coding-system nnmail-active-file-coding-system)
(pathname-coding-system 'binary)) ; for XEmacs/mule
(nnmail-find-file nnml-active-file)
article rest mod-time number)
(nnmail-activate 'nnml)
+ (setq active-articles (sort active-articles '<))
+ ;; Articles not listed in active-articles are already gone,
+ ;; so don't try to expire them.
+ (setq articles (gnus-sorted-intersection articles active-articles))
+
(while (and articles is-old)
(when (setq article (nnml-article-to-file (setq number (pop articles))))
(when (setq mod-time (nth 5 (file-attributes article)))
;; Just to make sure nothing went wrong when reading over NFS --
;; check once more.
(when (file-exists-p
- (setq file (concat nnml-current-directory "/"
- (number-to-string article))))
+ (setq file (expand-file-name (number-to-string article)
+ nnml-current-directory)))
(nnml-update-file-alist t)
file))))
;; Do this directory.
(let ((files (sort (nnheader-article-to-file-alist dir)
'car-less-than-car)))
- (when files
+ (if (not files)
+ (let* ((group (nnheader-file-to-group
+ (directory-file-name dir) nnml-directory))
+ (info (cadr (assoc group nnml-group-alist))))
+ (when info
+ (setcar info (1+ (cdr info)))))
(funcall nnml-generate-active-function dir)
;; Generate the nov file.
(nnml-generate-nov-file dir files)