* gnus-agent.el (gnus-agent-read-local): Bind
authorKevin Greiner <kevin.greiner@compsol.cc>
Tue, 9 Mar 2004 14:57:10 +0000 (14:57 +0000)
committerKevin Greiner <kevin.greiner@compsol.cc>
Tue, 9 Mar 2004 14:57:10 +0000 (14:57 +0000)
nnheader-file-coding-system to gnus-agent-file-coding-system to
avoid the implicit assumption that they will always be equal.
(gnus-agent-save-local): Bind buffer-file-coding-system, not
coding-system-for-write, as the with-temp-file macro first prints
to a buffer then saves the buffer.

lisp/ChangeLog
lisp/gnus-agent.el

index af6b041..401bcac 100644 (file)
@@ -1,3 +1,12 @@
+2004-03-09  Kevin Greiner <kgreiner@xpediantsolutions.com>
+
+       * gnus-agent.el (gnus-agent-read-local): Bind
+       nnheader-file-coding-system to gnus-agent-file-coding-system to
+       avoid the implicit assumption that they will always be equal.
+       (gnus-agent-save-local): Bind buffer-file-coding-system, not
+       coding-system-for-write, as the with-temp-file macro first prints
+       to a buffer then saves the buffer.
+
 2004-03-09  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-edit-part): New function.
index d77b6fa..70ceaab 100644 (file)
@@ -1860,7 +1860,8 @@ modified) original contents, they are first saved to their own file."
         (line 1))
     (with-temp-buffer
       (condition-case nil
-          (nnheader-insert-file-contents file)
+         (let ((nnheader-file-coding-system gnus-agent-file-coding-system))
+           (nnheader-insert-file-contents file))
         (file-error))
 
       (goto-char (point-min))
@@ -1903,27 +1904,27 @@ modified) original contents, they are first saved to their own file."
              ;; NOTE: gnus-command-method is used within gnus-agent-lib-file.
              (dest (gnus-agent-lib-file "local")))
         (gnus-make-directory (gnus-agent-lib-file ""))
-        (with-temp-file dest
-          (let ((gnus-command-method (symbol-value (intern "+method" my-obarray)))
-                (file-name-coding-system nnmail-pathname-coding-system)
-                (coding-system-for-write
-                 gnus-agent-file-coding-system)
-                print-level print-length item article
-                (standard-output (current-buffer)))
-            (mapatoms (lambda (symbol)
-                        (cond ((not (boundp symbol))
-                               nil)
-                              ((member (symbol-name symbol) '("+dirty" "+method"))
-                               nil)
-                              (t
-                               (prin1 symbol)
-                               (let ((range (symbol-value symbol)))
-                                 (princ " ")
-                                 (princ (car range))
-                                 (princ " ")
-                                 (princ (cdr range))
-                                 (princ "\n"))))) 
-                      my-obarray)))))))
+
+       (let ((buffer-file-coding-system gnus-agent-file-coding-system))
+         (with-temp-file dest
+           (let ((gnus-command-method (symbol-value (intern "+method" my-obarray)))
+                 (file-name-coding-system nnmail-pathname-coding-system)
+                 print-level print-length item article
+                 (standard-output (current-buffer)))
+             (mapatoms (lambda (symbol)
+                         (cond ((not (boundp symbol))
+                                nil)
+                               ((member (symbol-name symbol) '("+dirty" "+method"))
+                                nil)
+                               (t
+                                (prin1 symbol)
+                                (let ((range (symbol-value symbol)))
+                                  (princ " ")
+                                  (princ (car range))
+                                  (princ " ")
+                                  (princ (cdr range))
+                                  (princ "\n"))))) 
+                       my-obarray))))))))
 
 (defun gnus-agent-get-local (group)
   (let* ((gmane (gnus-group-real-name group))