Synch with `t-gnus-6_14' and Gnus.
[elisp/gnus.git-] / lisp / nnmbox.el
index 1793852..5c3a674 100644 (file)
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+(eval-when-compile (require 'static))
+
 (require 'nnheader)
 (require 'message)
 (require 'nnmail)
 (require 'nnoo)
-(eval-when-compile (require 'cl))
 
 (nnoo-declare nnmbox)
 
@@ -59,9 +61,9 @@
 (defvoo nnmbox-group-alist nil)
 (defvoo nnmbox-active-timestamp nil)
 
-(defvoo nnmbox-file-coding-system mm-text-coding-system)
+(defvoo nnmbox-file-coding-system nnheader-text-coding-system)
 (defvoo nnmbox-file-coding-system-for-write nil)
-(defvoo nnmbox-active-file-coding-system mm-text-coding-system)
+(defvoo nnmbox-active-file-coding-system nnheader-text-coding-system)
 (defvoo nnmbox-active-file-coding-system-for-write nil)
 
 \f
                       (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
                               nnmbox-file-coding-system))
                          (nnheader-find-file-noselect
                           nnmbox-mbox-file nil t))))
-      (mm-enable-multibyte)
       (buffer-disable-undo)))
   (when (not nnmbox-group-alist)
     (nnmail-activate 'nnmbox))
 (defun nnmbox-create-mbox ()
   (when (not (file-exists-p nnmbox-mbox-file))
     (let ((nnmail-file-coding-system
-          nnmbox-file-coding-system-for-write))
+          (or nnmbox-file-coding-system-for-write
+              nnmbox-file-coding-system)))
       (nnmail-write-region 1 1 nnmbox-mbox-file t 'nomesg))))
 
 (defun nnmbox-read-mbox ()
                                 nnmbox-file-coding-system))
                            (nnheader-find-file-noselect
                             nnmbox-mbox-file nil t))))
-       (mm-enable-multibyte)
-       (buffer-disable-undo)
+       (buffer-disable-undo)
 
        ;; Go through the group alist and compare against
        ;; the mbox file.