(gnus-gnus-to-newsrc-format): Use a unibyte buffer and raw-text coding system
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 7 Sep 2007 02:52:27 +0000 (02:52 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 7 Sep 2007 02:52:27 +0000 (02:52 +0000)
 when saving .newsrc file, which may contain non-ASCII group names.

lisp/ChangeLog
lisp/gnus-start.el

index 36b5406..70bd923 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-start.el (gnus-gnus-to-newsrc-format): Use a unibyte buffer and
+       raw-text coding system when saving .newsrc file, which may contain
+       non-ASCII group names.
+
 2007-09-05  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-cus.el (gnus-score-extra): New widget.
index 19926cc..0d3ba97 100644 (file)
@@ -2900,6 +2900,10 @@ If FORCE is non-nil, the .newsrc file is read."
       (setq default-directory (file-name-directory buffer-file-name))
       (buffer-disable-undo)
       (erase-buffer)
+      ;; Use a unibyte buffer since group names are unibyte strings;
+      ;; in particular, non-ASCII group names are the ones encoded by
+      ;; a certain coding system.
+      (mm-disable-multibyte)
       ;; Write options.
       (when gnus-newsrc-options
        (insert gnus-newsrc-options))
@@ -2942,7 +2946,8 @@ If FORCE is non-nil, the .newsrc file is read."
          (delete-file gnus-startup-file)
        (clear-visited-file-modtime))
       (gnus-run-hooks 'gnus-save-standard-newsrc-hook)
-      (save-buffer)
+      (let ((coding-system-for-write 'raw-text))
+       (save-buffer))
       (kill-buffer (current-buffer)))))
 
 \f