;;; nnml.el --- mail spool access for Gnus
-;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
(defvar nnml-nov-buffer-file-name nil)
-(defvoo nnml-file-coding-system nnmail-file-coding-system-1)
-
\f
;;; Interface functions.
(nnheader-report 'nnml "No such file: %s" path))
((file-directory-p path)
(nnheader-report 'nnml "File is a directory: %s" path))
- ((not (save-excursion (let ((nnmail-file-coding-system
- nnml-file-coding-system))
- (nnmail-find-file path))))
+ ((not (save-excursion (nnmail-find-file path)))
(nnheader-report 'nnml "Couldn't read file: %s" path))
(t
(nnheader-report 'nnml "Article %s retrieved" id)
t)
(deffoo nnml-request-create-group (group &optional server args)
- (nnml-possibly-change-directory nil server)
(nnmail-activate 'nnml)
(cond
((assoc group nnml-group-alist)
(deffoo nnml-request-list (&optional server)
(save-excursion
(let ((nnmail-file-coding-system nnmail-active-file-coding-system)
- (pathname-coding-system 'binary))
- (nnmail-find-file nnml-active-file))
+ (pathname-coding-system 'binary)) ; for XEmacs/mule
+ (nnmail-find-file nnml-active-file)
+ )
(setq nnml-group-alist (nnmail-get-active))
t))
((not (file-exists-p file))
(nnheader-report 'nnml "File %s does not exist" file))
(t
- (with-temp-file file
+ (nnheader-temp-write file
(nnheader-insert-file-contents file)
(nnmail-replace-status name value))
t))))
(defun nnml-find-group-number (id)
(save-excursion
(set-buffer (get-buffer-create " *nnml id*"))
+ (buffer-disable-undo (current-buffer))
(let ((alist nnml-group-alist)
number)
;; We want to look through all .overview files, but we want to
(file-exists-p nnml-current-directory))))
(defun nnml-possibly-create-directory (group)
- (let ((dir (nnmail-group-pathname group nnml-directory)))
- (unless (file-exists-p dir)
- (make-directory (directory-file-name dir) t)
- (nnheader-message 5 "Creating mail directory %s" dir))))
+ (let (dir dirs)
+ (setq dir (nnmail-group-pathname group nnml-directory))
+ (while (not (file-directory-p dir))
+ (push dir dirs)
+ (setq dir (file-name-directory (directory-file-name dir))))
+ (while dirs
+ (make-directory (directory-file-name (car dirs)))
+ (nnheader-message 5 "Creating mail directory %s" (car dirs))
+ (setq dirs (cdr dirs)))))
(defun nnml-save-mail (group-art)
"Called narrowed to an article."
(let ((dirs (directory-files dir t nil t))
dir)
(while (setq dir (pop dirs))
- (when (and (not (string-match "^\\." (file-name-nondirectory dir)))
+ (when (and (not (member (file-name-nondirectory dir) '("." "..")))
(file-directory-p dir))
(nnml-generate-nov-databases-1 dir seen))))
;; Do this directory.
(save-excursion
;; Init the nov buffer.
(set-buffer nov-buffer)
- (buffer-disable-undo)
+ (buffer-disable-undo (current-buffer))
(erase-buffer)
(set-buffer nntp-server-buffer)
;; Delete the old NOV file.