Revision: miles@gnu.org--gnu-2005/gnus--devo--0--patch-182
[gnus] / lisp / nnmbox.el
index bf62dfb..5f854da 100644 (file)
@@ -1,10 +1,10 @@
 ;;; nnmbox.el --- mail mbox access for Gnus
 
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
-;;     Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;;   2004, 2005 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
-;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
+;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Keywords: news, mail
 
 ;; This file is part of GNU Emacs.
@@ -16,8 +16,8 @@
 
 ;; 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, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 (nnoo-declare nnmbox)
 
 (defvoo nnmbox-mbox-file (expand-file-name "~/mbox")
-  "The name of the mail box file in the user's home directory.
-
-This variable is a virtual server slot.  See the Gnus manual for details.")
+  "The name of the mail box file in the user's home directory.")
 
 (defvoo nnmbox-active-file (expand-file-name "~/.mbox-active")
-  "The name of the active file for the mail box.
-
-This variable is a virtual server slot.  See the Gnus manual for details.")
+  "The name of the active file for the mail box.")
 
 (defvoo nnmbox-get-new-mail t
-  "If non-nil, nnmbox will check the incoming mail file and split the mail.
-
-This variable is a virtual server slot.  See the Gnus manual for details.")
+  "If non-nil, nnmbox will check the incoming mail file and split the mail.")
 
 (defvoo nnmbox-prepare-save-mail-hook nil
-  "Hook run narrowed to an article before saving.
-
-This variable is a virtual server slot.  See the Gnus manual for details.")
+  "Hook run narrowed to an article before saving.")
 
 \f
 
@@ -63,7 +55,7 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
 (defvoo nnmbox-current-group nil
   "Current nnmbox news group directory.")
 
-(defconst nnmbox-mbox-buffer nil)
+(defvar nnmbox-mbox-buffer nil)
 
 (defvoo nnmbox-status-string "")
 
@@ -292,7 +284,7 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
       (nconc rest articles))))
 
 (deffoo nnmbox-request-move-article
-    (article group server accept-form &optional last)
+    (article group server accept-form &optional last move-is-internal)
   (let ((buf (get-buffer-create " *nnmbox move*"))
        result)
     (and
@@ -305,8 +297,7 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
        (while (re-search-forward
               "^X-Gnus-Newsgroup:"
               (save-excursion (search-forward "\n\n" nil t) (point)) t)
-        (delete-region (progn (beginning-of-line) (point))
-                       (progn (forward-line 1) (point))))
+        (gnus-delete-line))
        (setq result (eval accept-form))
        (kill-buffer buf)
        result)
@@ -340,7 +331,10 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
        (while (re-search-backward "^X-Gnus-Newsgroup: " nil t)
         (delete-region (point) (progn (forward-line 1) (point))))
        (when nnmail-cache-accepted-message-ids
-        (nnmail-cache-insert (nnmail-fetch-field "message-id")))
+        (nnmail-cache-insert (nnmail-fetch-field "message-id") 
+                             group
+                             (nnmail-fetch-field "subject")
+                             (nnmail-fetch-field "from")))
        (setq result (if (stringp group)
                        (list (cons group (nnmbox-active-number group)))
                      (nnmail-article-group 'nnmbox-active-number)))
@@ -431,9 +425,7 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
   (if (not force)
       (nnmbox-record-deleted-article (nnmbox-article-group-number t)))
   (or force
-      (delete-region
-       (progn (beginning-of-line) (point))
-       (progn (forward-line 1) (point))))
+      (gnus-delete-line))
   ;; Beginning of the article.
   (save-excursion
     (save-restriction
@@ -483,7 +475,7 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
     (when (re-search-forward "^X-Gnus-Newsgroup: +\\([^:]+\\):\\([0-9]+\\) "
                             nil t)
       (cons (buffer-substring (match-beginning 1) (match-end 1))
-           (string-to-int
+           (string-to-number
             (buffer-substring (match-beginning 2) (match-end 2)))))))
 
 (defun nnmbox-in-header-p (pos)
@@ -610,7 +602,8 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
               nnmbox-file-coding-system))
          (dir (file-name-directory nnmbox-mbox-file)))
       (and dir (gnus-make-directory dir))
-      (nnmail-write-region 1 1 nnmbox-mbox-file t 'nomesg))))
+      (nnmail-write-region (point-min) (point-min)
+                          nnmbox-mbox-file t 'nomesg))))
 
 (defun nnmbox-read-mbox ()
   (nnmail-activate 'nnmbox)
@@ -688,7 +681,7 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
                    (let (alist)
                      (while (re-search-forward " \\([^:]+\\):\\([0-9]+\\)" end-header t)
                        (push (cons (match-string 1)
-                                   (string-to-int (match-string 2))) alist))
+                                   (string-to-number (match-string 2))) alist))
                      (nnmbox-insert-newsgroup-line alist))
                  ;; this is really a new article
                  (nnmbox-save-mail
@@ -702,4 +695,5 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
 
 (provide 'nnmbox)
 
+;;; arch-tag: 611dd95f-be37-413a-b3ae-8b059ba93659
 ;;; nnmbox.el ends here