Sync
authoryamaoka <yamaoka>
Tue, 6 Jun 2000 11:21:36 +0000 (11:21 +0000)
committeryamaoka <yamaoka>
Tue, 6 Jun 2000 11:21:36 +0000 (11:21 +0000)
with `t-gnus-6_14'.

* message.el (message-save-drafts): Rewrite.

Sync with Gnus 200006050242 (quimby's clock may lose a day :-).

* nnheader.el (nnheader-text-coding-system-for-write,
nnheader-text-coding-system): New variables, substitutes for
`mm-text-coding-system-for-write' or `mm-text-coding-system'.

* nnmbox.el (nnmbox-active-file-coding-system, nnmbox-file-coding-system): Use
`nnheader-text-coding-system'.
* nnmail.el (nnmail-incoming-coding-system): Ditto.
* nnfolder.el (nnfolder-file-coding-system): Ditto.
(nnfolder-active-file-coding-system): Ditto.

* mail-source.el (mail-source-text-coding-system): Remove.
(TopLevel): require `nnheader'.

* nndraft.el (nndraft-request-article): Bind coding system to
`nnheader-text-coding-system'.
(nndraft-request-replace-article): Ditto.
* mail-source.el (mail-source-fetch-maildir): Ditto.
* gnus-uu.el (gnus-uu-save-article): Ditto.
* gnus-util.el (gnus-output-to-mail, gnus-output-to-rmail): Ditto.
* gnus-soup.el (gnus-soup-write-prefixes): Ditto.

* gnus-util.el (gnus-write-buffer): Bind `file-name-coding-system' to
`nnmail-pathname-coding-system'.
* gnus-start.el (gnus-slave-save-newsrc): Bind coding system to
`gnus-startup-file-coding-system'.

13 files changed:
ChangeLog
lisp/ChangeLog
lisp/gnus-soup.el
lisp/gnus-start.el
lisp/gnus-util.el
lisp/gnus-uu.el
lisp/mail-source.el
lisp/message.el
lisp/nndraft.el
lisp/nnfolder.el
lisp/nnheader.el
lisp/nnmail.el
lisp/nnmbox.el

index afdbc44..63afbe8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,36 @@
 2000-06-06  Katsumi Yamaoka <yamaoka@jpl.org>
 
+       * lisp/message.el (message-save-drafts): Rewrite.
+
+       * lisp/nnheader.el (nnheader-text-coding-system-for-write,
+       nnheader-text-coding-system): New variables, substitutes for
+       `mm-text-coding-system-for-write' or `mm-text-coding-system'.
+
+       * lisp/nnmbox.el (nnmbox-active-file-coding-system,
+       nnmbox-file-coding-system): Use `nnheader-text-coding-system'.
+       * lisp/nnmail.el (nnmail-incoming-coding-system): Ditto.
+       * lisp/nnfolder.el (nnfolder-file-coding-system): Ditto.
+       (nnfolder-active-file-coding-system): Ditto.
+
+       * lisp/mail-source.el (mail-source-text-coding-system): Remove.
+       (TopLevel): require `nnheader'.
+
+       * lisp/nndraft.el (nndraft-request-article): Bind coding system to
+       `nnheader-text-coding-system'.
+       (nndraft-request-replace-article): Ditto.
+       * lisp/mail-source.el (mail-source-fetch-maildir): Ditto.
+       * lisp/gnus-uu.el (gnus-uu-save-article): Ditto.
+       * lisp/gnus-util.el (gnus-output-to-mail, gnus-output-to-rmail):
+       Ditto.
+       * lisp/gnus-soup.el (gnus-soup-write-prefixes): Ditto.
+
+       * lisp/gnus-util.el (gnus-write-buffer): Bind
+       `file-name-coding-system' to `nnmail-pathname-coding-system'.
+       * lisp/gnus-start.el (gnus-slave-save-newsrc): Bind coding system
+       to `gnus-startup-file-coding-system'.
+
+2000-06-06  Katsumi Yamaoka <yamaoka@jpl.org>
+
        * lisp/gnus-vers.el (gnus-revision-number): Increment to 03.
 
        * lisp/message.el (message-fix-before-sending): Don't check for
index 8d72fa0..02ccf8a 100644 (file)
@@ -1,3 +1,14 @@
+2000-06-05 22:25:12  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-cache.el (gnus-cache-possibly-enter-article): Bind coding
+       system.
+       * gnus-soup.el (gnus-soup-write-prefixes): Ditto.
+       * gnus-start.el (gnus-slave-save-newsrc): Ditto.
+       * gnus-util.el (gnus-output-to-rmail): Ditto.
+       (gnus-output-to-mail): Ditto.
+       (gnus-write-buffer): Ditto.
+       * gnus-uu.el (gnus-uu-save-article): Ditto.
+
 2000-06-04 15:05:16  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-read-from-minibuffer): Typo.
index 56a2b82..20a510a 100644 (file)
@@ -336,7 +336,9 @@ If NOT-ALL, don't pack ticked articles."
       (while (setq prefix (pop prefixes))
        (erase-buffer)
        (insert (format "(setq gnus-soup-prev-prefix %d)\n" (cdr prefix)))
-       (gnus-write-buffer (concat (car prefix) gnus-soup-prefix-file))))))
+       (gnus-write-buffer-as-coding-system
+        nnheader-text-coding-system
+        (concat (car prefix) gnus-soup-prefix-file))))))
 
 (defun gnus-soup-pack (dir packer)
   (let* ((files (mapconcat 'identity
index e5730ab..30937a7 100644 (file)
@@ -2638,7 +2638,8 @@ The backup file \".newsrc.eld_\" will be created before re-reading."
           (make-temp-name (concat gnus-current-startup-file "-slave-")))
          (modes (ignore-errors
                   (file-modes (concat gnus-current-startup-file ".eld")))))
-      (gnus-write-buffer slave-name)
+      (gnus-write-buffer-as-coding-system
+       gnus-startup-file-coding-system slave-name)
       (when modes
        (set-file-modes slave-name modes)))))
 
index 263248a..ad55a7b 100644 (file)
@@ -581,8 +581,10 @@ Bind `print-quoted' and `print-readably' to t while printing."
   "Write the current buffer's contents to FILE."
   ;; Make sure the directory exists.
   (gnus-make-directory (file-name-directory file))
-  ;; Write the buffer.
-  (write-region (point-min) (point-max) file nil 'quietly))
+  (let ((file-name-coding-system nnmail-pathname-coding-system)
+       (pathname-coding-system nnmail-pathname-coding-system))
+    ;; Write the buffer.
+    (write-region (point-min) (point-max) file nil 'quietly)))
 
 (defun gnus-write-buffer-as-binary (file)
   "Write the current buffer's contents to FILE without code conversion."
@@ -730,7 +732,8 @@ with potentially long computations."
                  (set-buffer file-buffer)
                  (rmail-insert-rmail-file-header)
                  (let ((require-final-newline nil))
-                   (gnus-write-buffer filename)))
+                   (gnus-write-buffer-as-coding-system
+                    nnheader-text-coding-system filename)))
                (kill-buffer file-buffer))
            (error "Output file does not exist")))
       (set-buffer tmpbuf)
@@ -781,7 +784,8 @@ with potentially long computations."
              (save-excursion
                (set-buffer file-buffer)
                (let ((require-final-newline nil))
-                 (gnus-write-buffer-as-binary filename)))
+                 (gnus-write-buffer-as-coding-system
+                  nnheader-text-coding-system filename)))
              (kill-buffer file-buffer))
          (error "Output file does not exist")))
       (set-buffer tmpbuf)
index 45713bd..74ec1f4 100644 (file)
@@ -820,7 +820,8 @@ When called interactively, prompt for REGEXP."
    (gnus-uu-save-separate-articles
     (save-excursion
       (set-buffer buffer)
-      (gnus-write-buffer
+      (gnus-write-buffer-as-coding-system
+       nnheader-text-coding-system
        (concat gnus-uu-saved-article-name gnus-current-article))
       (cond ((eq in-state 'first) (list gnus-uu-saved-article-name 'begin))
            ((eq in-state 'first-and-last) (list gnus-uu-saved-article-name
@@ -920,7 +921,8 @@ When called interactively, prompt for REGEXP."
                (with-current-buffer gnus-uu-digest-buffer
                  (erase-buffer)
                  (insert-buffer "*gnus-uu-pre*"))
-             (gnus-write-buffer gnus-uu-saved-article-name)))
+             (gnus-write-buffer-as-coding-system
+              nnheader-text-coding-system gnus-uu-saved-article-name)))
          (save-excursion
            (set-buffer "*gnus-uu-body*")
            (goto-char (point-max))
@@ -932,8 +934,11 @@ When called interactively, prompt for REGEXP."
                (with-current-buffer gnus-uu-digest-buffer
                  (goto-char (point-max))
                  (insert-buffer "*gnus-uu-body*"))
-             (write-region
-              (point-min) (point-max) gnus-uu-saved-article-name t))))
+             (let ((file-name-coding-system nnmail-pathname-coding-system)
+                   (pathname-coding-system nnmail-pathname-coding-system))
+               (write-region-as-coding-system
+                nnheader-text-coding-system
+                (point-min) (point-max) gnus-uu-saved-article-name t)))))
        (gnus-kill-buffer "*gnus-uu-pre*")
        (gnus-kill-buffer "*gnus-uu-body*")
        (push 'end state))
index 9c616ff..016fcc7 100644 (file)
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl))
+(require 'nnheader)
 (eval-and-compile
   (autoload 'pop3-movemail "pop3")
   (autoload 'pop3-get-message-count "pop3"))
@@ -77,12 +78,6 @@ If non-nil, this maildrop will be checked periodically for new mail."
   :group 'mail-source
   :type 'number)
 
-(defvar mail-source-text-coding-system
-  (if (memq system-type '(windows-nt ms-dos ms-windows))
-      'raw-text-dos
-    'raw-text)
-  "Text-safe coding system (For removing ^M).")
-
 ;;; Internal variables.
 
 (defvar mail-source-string ""
@@ -626,13 +621,13 @@ This only works when `display-time' is enabled."
                       (not (if function
                                (funcall function file mail-source-crash-box)
                              (let ((coding-system-for-write
-                                    mail-source-text-coding-system)
+                                    nnheader-text-coding-system)
                                    (coding-system-for-read
-                                    mail-source-text-coding-system)
+                                    nnheader-text-coding-system)
                                    (output-coding-system
-                                    mail-source-text-coding-system)
+                                    nnheader-text-coding-system)
                                    (input-coding-system
-                                    mail-source-text-coding-system))
+                                    nnheader-text-coding-system))
                                (with-temp-file mail-source-crash-box
                                  (insert-file-contents file)
                                  (goto-char (point-min))
@@ -658,8 +653,7 @@ This only works when `display-time' is enabled."
   (autoload 'imap-close "imap")
   (autoload 'imap-error-text "imap")
   (autoload 'imap-message-flags-add "imap")
-  (autoload 'imap-list-to-message-set "imap")
-  (autoload 'nnheader-ms-strip-cr "nnheader"))
+  (autoload 'imap-list-to-message-set "imap"))
 
 (defun mail-source-fetch-imap (source callback)
   "Fetcher for imap sources."
index 01e477d..a09f10e 100644 (file)
@@ -5400,23 +5400,19 @@ regexp varstr."
     (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook))
       (read-string prompt))))
 
-(defvar message-save-buffer " *encoding")
 (defun message-save-drafts ()
+  "Postponing the message."
   (interactive)
-  (if (not (get-buffer message-save-buffer))
-      (get-buffer-create message-save-buffer))
-  (let ((filename buffer-file-name)
-       (buffer (current-buffer))
-       (reply-headers message-reply-headers))
-    (set-buffer message-save-buffer)
-    (erase-buffer)
-    (insert-buffer buffer)
-    (setq message-reply-headers reply-headers)
-    (message-generate-headers  '((optional . In-Reply-To)))
-    (mime-edit-translate-buffer)
-    (write-region (point-min) (point-max) filename)
-    (set-buffer buffer)
-    (set-buffer-modified-p nil)))
+  (message "Saving %s..." buffer-file-name)
+  (let ((reply-headers message-reply-headers)
+       (msg (buffer-substring-no-properties (point-min) (point-max))))
+    (with-temp-file buffer-file-name
+      (insert msg)
+      (setq message-reply-headers reply-headers)
+      (message-generate-headers '((optional . In-Reply-To)))
+      (mime-edit-translate-buffer))
+    (set-buffer-modified-p nil))
+  (message "Saving %s...done" buffer-file-name))
 
 (provide 'message)
 
index 763b7bc..5bee2cf 100644 (file)
           (newest (if (file-newer-than-file-p file auto) file auto))
           (nntp-server-buffer (or buffer nntp-server-buffer)))
       (when (and (file-exists-p newest)
-                (nnmail-find-file newest))
+                (let ((nnmail-file-coding-system nnheader-text-coding-system))
+                  (nnmail-find-file newest)))
        (save-excursion
          (set-buffer nntp-server-buffer)
          (goto-char (point-min))
 
 (deffoo nndraft-request-replace-article (article group buffer)
   (nndraft-possibly-change-group group)
-  (let ((nnmail-file-coding-system
-        (if (equal group "drafts")
-            message-draft-coding-system
-          mail-source-text-coding-system)))
+  (let ((nnmail-file-coding-system nnheader-text-coding-system))
     (nnoo-parent-function 'nndraft 'nnmh-request-replace-article
                          (list article group buffer))))
 
index fe757b6..33718e9 100644 (file)
@@ -93,12 +93,10 @@ message, a huge time saver for large mailboxes.")
 (defvoo nnfolder-buffer-alist nil)
 (defvoo nnfolder-scantime-alist nil)
 (defvoo nnfolder-active-timestamp nil)
-(defvoo nnfolder-active-file-coding-system
-    (if (memq system-type '(windows-nt ms-dos ms-windows))
-       'raw-text-dos 'raw-text))
+(defvoo nnfolder-active-file-coding-system nnheader-text-coding-system)
 (defvoo nnfolder-active-file-coding-system-for-write 
     nnmail-active-file-coding-system)
-(defvoo nnfolder-file-coding-system nnfolder-active-file-coding-system)
+(defvoo nnfolder-file-coding-system nnheader-text-coding-system)
 (defvoo nnfolder-file-coding-system-for-write nnheader-file-coding-system
   "Coding system for save nnfolder file.
 If NIL, NNFOLDER-FILE-CODING-SYSTEM is used.")
index c100d3a..ccf78ff 100644 (file)
@@ -49,6 +49,17 @@ on your system, you could say something like:
 
 \(setq nnheader-file-name-translation-alist '((?: . ?_)))")
 
+(defvar nnheader-text-coding-system
+  (if (memq system-type '(windows-nt ms-dos ms-windows))
+      'raw-text-dos
+    'raw-text)
+  "Text-safe coding system (For removing ^M).
+This variable is a substitute for `mm-text-coding-system'.")
+
+(defvar nnheader-text-coding-system-for-write nil
+  "Text coding system for write.
+This variable is a substitute for `mm-text-coding-system-for-write'.")
+
 (eval-and-compile
   (autoload 'nnmail-message-id "nnmail")
   (autoload 'mail-position-on-field "sendmail")
index d496f71..b4df106 100644 (file)
@@ -460,7 +460,8 @@ parameter.  It should return nil, `warn' or `delete'."
 (defvar nnmail-file-coding-system 'raw-text
   "Coding system used in nnmail.")
 
-(defvar nnmail-incoming-coding-system 'raw-text
+(defvar nnmail-incoming-coding-system
+  nnheader-text-coding-system
   "Coding system used in reading inbox")
 
 (defvar nnmail-pathname-coding-system 'binary
index 3deac05..5c3a674 100644 (file)
 (defvoo nnmbox-group-alist nil)
 (defvoo nnmbox-active-timestamp nil)
 
-(defvoo nnmbox-file-coding-system
-    (if (memq system-type '(windows-nt ms-dos ms-windows))
-       'raw-text-dos 'raw-text))
+(defvoo nnmbox-file-coding-system nnheader-text-coding-system)
 (defvoo nnmbox-file-coding-system-for-write nil)
-(defvoo nnmbox-active-file-coding-system nnmbox-file-coding-system)
+(defvoo nnmbox-active-file-coding-system nnheader-text-coding-system)
 (defvoo nnmbox-active-file-coding-system-for-write nil)
 
 \f