*** empty log message ***
[gnus] / lisp / nnfolder.el
index eb9b8ce..3f8811f 100644 (file)
@@ -1,10 +1,10 @@
 ;;; nnfolder.el --- mail folder access for Gnus
 ;;; nnfolder.el --- mail folder access for Gnus
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97,98 Free Software Foundation, Inc.
 
 ;; Author: Scott Byer <byer@mv.us.adobe.com>
 ;;     Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 
 ;; Author: Scott Byer <byer@mv.us.adobe.com>
 ;;     Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
-;; Keywords: news, mail
+;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
 
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
 ;; 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:
 
 
 ;;; Commentary:
 
-;; For an overview of what the interface functions do, please see the
-;; Gnus sources.  
-
-;; Various enhancements by byer@mv.us.adobe.com (Scott Byer).
-
 ;;; Code:
 
 (require 'nnheader)
 ;;; Code:
 
 (require 'nnheader)
-(require 'rmail)
+(require 'message)
 (require 'nnmail)
 (require 'nnmail)
+(require 'nnoo)
+(require 'cl)
+(require 'gnus-util)
+
+(nnoo-declare nnfolder)
 
 
-(defvar nnfolder-directory (expand-file-name "~/Mail/")
-  "The name of the mail box file in the users home directory.")
+(defvoo nnfolder-directory (expand-file-name message-directory)
+  "The name of the nnfolder directory.")
 
 
-(defvar nnfolder-active-file 
-  (concat (file-name-as-directory nnfolder-directory) "active")
+(defvoo nnfolder-active-file
+  (nnheader-concat nnfolder-directory "active")
   "The name of the active file.")
 
   "The name of the active file.")
 
-;; I renamed this variable to somehting more in keeping with the general GNU
+;; I renamed this variable to something more in keeping with the general GNU
 ;; style. -SLB
 
 ;; style. -SLB
 
-(defvar nnfolder-ignore-active-file nil
-  "If non-nil, causes nnfolder to do some extra work in order to determine the true active ranges of an mbox file.  
-Note that the active file is still saved, but it's values are not
-used.  This costs some extra time when scanning an mbox when opening
-it.")
-
-;; Note that this variable may not be completely implemented yet. -SLB
-
-(defvar nnfolder-always-close nil
-  "If non-nil, nnfolder attempts to only ever have one mbox open at a time.  
-This is a straight space/performance trade off, as the mboxes will have to 
-be scanned every time they are read in.  If nil (default), nnfolder will
-attempt to keep the buffers around (saving the nnfolder's buffer upon group 
-close, but not killing it), speeding some things up tremendously, especially
-such things as moving mail.  All buffers always get killed upon server close.")
-
-(defvar nnfolder-newsgroups-file 
-  (concat (file-name-as-directory  nnfolder-directory) "newsgroups")
+(defvoo nnfolder-ignore-active-file nil
+  "If non-nil, causes nnfolder to do some extra work in order to determine
+the true active ranges of an mbox file.  Note that the active file is still
+saved, but it's values are not used.  This costs some extra time when
+scanning an mbox when opening it.")
+
+(defvoo nnfolder-distrust-mbox nil
+  "If non-nil, causes nnfolder to not trust the user with respect to
+inserting unaccounted for mail in the middle of an mbox file.  This can greatly
+slow down scans, which now must scan the entire file for unmarked messages.
+When nil, scans occur forward from the last marked message, a huge
+time saver for large mailboxes.")
+
+(defvoo nnfolder-newsgroups-file
+  (concat (file-name-as-directory nnfolder-directory) "newsgroups")
   "Mail newsgroups description file.")
 
   "Mail newsgroups description file.")
 
-(defvar nnfolder-get-new-mail t
+(defvoo nnfolder-get-new-mail t
   "If non-nil, nnfolder will check the incoming mail file and split the mail.")
 
   "If non-nil, nnfolder will check the incoming mail file and split the mail.")
 
-(defvar nnfolder-prepare-save-mail-hook nil
+(defvoo nnfolder-prepare-save-mail-hook nil
   "Hook run narrowed to an article before saving.")
 
   "Hook run narrowed to an article before saving.")
 
+(defvoo nnfolder-save-buffer-hook nil
+  "Hook run before saving the nnfolder mbox buffer.")
+
+(defvoo nnfolder-inhibit-expiry nil
+  "If non-nil, inhibit expiry.")
+
 \f
 
 (defconst nnfolder-version "nnfolder 1.0"
 \f
 
 (defconst nnfolder-version "nnfolder 1.0"
@@ -79,433 +83,522 @@ such things as moving mail.  All buffers always get killed upon server close.")
 (defconst nnfolder-article-marker "X-Gnus-Article-Number: "
   "String used to demarcate what the article number for a message is.")
 
 (defconst nnfolder-article-marker "X-Gnus-Article-Number: "
   "String used to demarcate what the article number for a message is.")
 
-(defvar nnfolder-current-group nil)
-(defvar nnfolder-current-buffer nil)
-(defvar nnfolder-status-string "")
-(defvar nnfolder-group-alist nil)
-(defvar nnfolder-buffer-alist nil)
-(defvar nnfolder-active-timestamp nil)
-
-(defmacro nnfolder-article-string (article)
-  (` (concat "\n" nnfolder-article-marker (int-to-string (, article)) " ")))
-
-\f
-
-(defvar nnfolder-current-server nil)
-(defvar nnfolder-server-alist nil)
-(defvar nnfolder-server-variables 
-  (list 
-   (list 'nnfolder-directory nnfolder-directory)
-   (list 'nnfolder-active-file nnfolder-active-file)
-   (list 'nnfolder-newsgroups-file nnfolder-newsgroups-file)
-   (list 'nnfolder-get-new-mail nnfolder-get-new-mail)
-   '(nnfolder-current-group nil)
-   '(nnfolder-current-buffer nil)
-   '(nnfolder-status-string "")
-   '(nnfolder-group-alist nil)
-   '(nnfolder-buffer-alist nil)
-   '(nnfolder-active-timestamp nil)))
+(defvoo nnfolder-current-group nil)
+(defvoo nnfolder-current-buffer nil)
+(defvoo nnfolder-status-string "")
+(defvoo nnfolder-group-alist nil)
+(defvoo nnfolder-buffer-alist nil)
+(defvoo nnfolder-scantime-alist nil)
+(defvoo nnfolder-active-timestamp nil)
 
 \f
 
 ;;; Interface functions
 
 
 \f
 
 ;;; Interface functions
 
-(defun nnfolder-retrieve-headers (sequence &optional newsgroup server)
+(nnoo-define-basics nnfolder)
+
+(deffoo nnfolder-retrieve-headers (articles &optional group server fetch-old)
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)
   (save-excursion
   &n