*** empty log message ***
[gnus] / lisp / nnml.el
index 3640352..f116fab 100644 (file)
@@ -1,5 +1,5 @@
 ;;; nnml.el --- mail spool access for Gnus
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -18,8 +18,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
 
 (require 'nnheader)
 (require 'nnmail)
+(require 'nnoo)
+(require 'cl)
 
-(defvar nnml-directory "~/Mail/"
+(nnoo-declare nnml)
+
+(defvoo nnml-directory message-directory
   "Mail spool directory.")
 
-(defvar nnml-active-file (concat nnml-directory "active")
+(defvoo nnml-active-file 
+  (concat (file-name-as-directory nnml-directory) "active")
   "Mail active file.")
 
-(defvar nnml-newsgroups-file (concat nnml-directory "newsgroups")
+(defvoo nnml-newsgroups-file 
+  (concat (file-name-as-directory nnml-directory) "newsgroups")
   "Mail newsgroups description file.")
 
-(defvar nnml-get-new-mail t
+(defvoo nnml-get-new-mail t
   "If non-nil, nnml will check the incoming mail file and split the mail.")
 
-(defvar nnml-nov-is-evil nil
+(defvoo nnml-nov-is-evil nil
   "If non-nil, Gnus will never generate and use nov databases for mail groups.
 Using nov databases will speed up header fetching considerably.
-This variable shouldn't be flipped much. If you have, for some reason,
+This variable shouldn't be flipped much.  If you have, for some reason,
 set this to t, and want to set it to nil again, you should always run
-the `nnml-generate-nov-databases' command. The function will go
+the `nnml-generate-nov-databases' command.  The function will go
 through all nnml directories and generate nov databases for them
-all. This may very well take some time.")
+all.  This may very well take some time.")
+
+(defvoo nnml-prepare-save-mail-hook nil
+  "Hook run narrowed to an article before saving.")
+
+(defvoo nnml-inhibit-expiry nil
+  "If non-nil, inhibit expiry.")
+
 
 \f
 
-(defconst nnml-version "nnml 0.2"
+(defconst nnml-version "nnml 1.0"
   "nnml version.")
 
-(defvar nnml-nov-file-name ".overview")
-
-(defvar nnml-current-directory nil)
-(defvar nnml-status-string "")
-(defvar nnml-nov-buffer-alist nil)
-(defvar nnml-group-alist nil)
-(defvar nnml-active-timestamp nil)
+(defvoo nnml-nov-file-name ".overview")
 
-\f
+(defvoo nnml-current-directory nil)
+(defvoo nnml-current-group nil)
+(defvoo nnml-status-string "")
+(defvoo nnml-nov-buffer-alist nil)
+(defvoo nnml-group-alist nil)
+(defvoo nnml-active-timestamp nil)
+(defvoo nnml-article-file-alist nil)
 
-;; Server variables.
-
-(defvar nnml-current-server nil)
-(defvar nnml-server-alist nil)
-(defvar nnml-server-variables 
-  (list 
-   (list 'nnml-directory nnml-directory)
-   (list 'nnml-active-file nnml-active-file)
-   (list 'nnml-newsgroups-file nnml-newsgroups-file)
-   (list 'nnml-get-new-mail nnml-get-new-mail)
-   (list 'nnml-nov-is-evil nnml-nov-is-evil)
-   (list 'nnml-nov-file-name nnml-nov-file-name)
-   '(nnml-current-directory nil)
-   '(nnml-status-string "")
-   '(nnml-nov-buffer-alist nil)
-   '(nnml-group-alist nil)
-   '(nnml-active-timestamp nil)))
+(defvoo nnml-generate-active-function 'nnml-generate-active-info)
 
 \f
 
 ;;; Interface functions.
 
-(defun nnml-retrieve-headers (sequence &optional newsgroup server)
+(nnoo-define-basics nnml)
+
+(deffoo nnml-retrieve-headers (sequence &optional newsgroup server fetch-old)
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)
@@ -98,200 +98,204 @@ all. This may very well take some time.")
          (number (length sequence))
          (count 0)
          beg article)
-      (nnml-possibly-change-directory newsgroup)
-      (if (nnml-retrieve-headers-with-nov sequence)
-         'nov
-       (while sequence
-         (setq article (car sequence))
-         (setq file
-               (concat nnml-current-directory (prin1-to-string article)))
-         (if (and (file-exists-p file)
-                  (not (file-directory-p file)))
-             (progn
-               (insert (format "221 %d Article retrieved.\n" article))
-