;; 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.
;;; Code:
+(eval-when-compile (require 'cl))
+(eval-when-compile (require 'static))
+
(require 'nnheader)
(require 'message)
(require 'nnmail)
(require 'nnoo)
(require 'gnus-range)
-(eval-when-compile (require 'cl))
(nnoo-declare nnmbox)
(defvoo nnmbox-group-alist nil)
(defvoo nnmbox-active-timestamp nil)
-(defvoo nnmbox-file-coding-system mm-binary-coding-system)
+(defvoo nnmbox-file-coding-system 'binary)
(defvoo nnmbox-file-coding-system-for-write nil)
-(defvoo nnmbox-active-file-coding-system mm-binary-coding-system)
+(defvoo nnmbox-active-file-coding-system 'binary)
(defvoo nnmbox-active-file-coding-system-for-write nil)
(defvar nnmbox-group-building-active-articles nil)
(1+ (- (cdr active) (car active)))
(car active) (cdr active) group)))))
-(defun nnmbox-save-buffer ()
- (let ((coding-system-for-write
- (or nnmbox-file-coding-system-for-write
- nnmbox-file-coding-system)))
- (save-buffer)))
+(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-active (group-alist active-file)
(let ((nnmail-active-file-coding-system
(progn
(unless (eq nnmail-expiry-target 'delete)
(with-temp-buffer
- (nnmbox-request-article (car articles)
- newsgroup server
- (current-buffer))
+ (nnmbox-request-article (car articles)
+ newsgroup server
+ (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))
(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)
(when (not (file-exists-p nnmbox-mbox-file))
(let ((nnmail-file-coding-system
(or nnmbox-file-coding-system-for-write
- nnmbox-file-coding-system)))
+ 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))))
(defun nnmbox-read-mbox ()
(let ((nnheader-file-coding-system
nnmbox-file-coding-system))
(nnheader-find-file-noselect
- nnmbox-mbox-file nil t))))
- (mm-enable-multibyte)
+ nnmbox-mbox-file t t))))
(buffer-disable-undo)
;; Go through the group alist and compare against the mbox file.