X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnnmbox.el;h=fe4a30bc32d7332f928c359259b9f4ee3a392d08;hb=9b741e050b400987d68ff761c6cc3276c932839c;hp=f45b7f2d8d3db22bae9b2b961adc1c88d48f927e;hpb=1a7b8c37b8aadeae04f57577c44f9be28f3e4398;p=elisp%2Fgnus.git- diff --git a/lisp/nnmbox.el b/lisp/nnmbox.el index f45b7f2..fe4a30b 100644 --- a/lisp/nnmbox.el +++ b/lisp/nnmbox.el @@ -1,6 +1,6 @@ ;;; nnmbox.el --- mail mbox access for Gnus -;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -38,24 +38,16 @@ (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.") @@ -197,18 +189,11 @@ This variable is a virtual server slot. See the Gnus manual for details.") (1+ (- (cdr active) (car active))) (car active) (cdr active) group))))) -(static-if (boundp 'MULE) - (defun nnmbox-save-buffer () - (let ((output-coding-system - (or nnmbox-file-coding-system-for-write - nnmbox-file-coding-system))) - (save-buffer))) - (defun nnmbox-save-buffer () - (let ((coding-system-for-write - (or nnmbox-file-coding-system-for-write - nnmbox-file-coding-system))) - (save-buffer))) - ) +(defun nnmbox-save-buffer () + (let* ((coding-system-for-write (or nnmbox-file-coding-system-for-write + nnmbox-file-coding-system)) + (output-coding-system coding-system-for-write)) + (save-buffer))) (defun nnmbox-save-active (group-alist active-file) (let ((nnmail-active-file-coding-system @@ -284,7 +269,8 @@ This variable is a virtual server slot. See the Gnus manual for details.") (current-buffer)) (let ((nnml-current-directory nil)) (nnmail-expiry-target-group - nnmail-expiry-target newsgroup)))) + nnmail-expiry-target newsgroup))) + (nnmbox-possibly-change-newsgroup newsgroup server)) (nnheader-message 5 "Deleting article %d in %s..." (car articles) newsgroup) (nnmbox-delete-mail)) @@ -348,7 +334,7 @@ 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)) (setq result (if (stringp group) (list (cons group (nnmbox-active-number group))) (nnmail-article-group 'nnmbox-active-number))) @@ -519,9 +505,9 @@ This variable is a virtual server slot. See the Gnus manual for details.") (nnmbox-in-header-p (point))) (progn (goto-char (point-min)) - (while (not found) - (setq found (and (search-forward art-string nil t) - (nnmbox-in-header-p (point))))) + (while (and (not found) + (search-forward art-string nil t)) + (setq found (nnmbox-in-header-p (point)))) found))))) (defun nnmbox-record-active-article (group-art) @@ -615,8 +601,11 @@ This variable is a virtual server slot. See the Gnus manual for details.") (when (not (file-exists-p nnmbox-mbox-file)) (let ((nnmail-file-coding-system (or nnmbox-file-coding-system-for-write - nnmbox-file-coding-system))) - (nnmail-write-region 1 1 nnmbox-mbox-file t 'nomesg)))) + nnmbox-file-coding-system)) + (dir (file-name-directory nnmbox-mbox-file))) + (and dir (gnus-make-directory dir)) + (nnmail-write-region (point-min) (point-min) + nnmbox-mbox-file t 'nomesg)))) (defun nnmbox-read-mbox () (nnmail-activate 'nnmbox)