Clean up active coding system.
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 17 May 2000 04:18:55 +0000 (04:18 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 17 May 2000 04:18:55 +0000 (04:18 +0000)
lisp/ChangeLog
lisp/gnus-agent.el
lisp/gnus-cache.el
lisp/gnus-start.el
lisp/gnus-sum.el
lisp/gnus-util.el

index 0e12a74..3669266 100644 (file)
@@ -1,3 +1,21 @@
+2000-05-16 23:20:42  Shenghuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-agent.el (gnus-agent-synchronize): Use
+       nnheader-insert-file-contents.
+       (gnus-agent-save-active-1): Ditto.
+       (gnus-agent-write-active): Ditto.
+       (gnus-agent-expire): Ditto.
+       * gnus-cache.el (gnus-cache-read-active): Ditto.
+       * gnus-start.el (gnus-master-read-slave-newsrc): Ditto.
+       * gnus-sum.el (gnus-summary-import-article): Ditto.
+       
+       * gnus-agent.el (gnus-agent-write-servers): Bind coding-system.
+       (gnus-agent-save-group-info): Ditto.
+       (gnus-agent-save-alist): Ditto.
+       * gnus-util.el (gnus-make-directory): Ditto.
+       
+       * gnus-agent.el (gnus-agent-save-group-info): Disable multibyte.
+
 2000-05-16 21:13:24  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
        * mml.el (mml-generate-mime-preprocess-function): New variable.
index fae871e..9809bba 100644 (file)
@@ -433,7 +433,7 @@ Currently sends flag setting requests, if any."
       (when (file-exists-p (gnus-agent-lib-file "flags"))
        (set-buffer (get-buffer-create " *Gnus Agent flag synchronize*"))
        (erase-buffer)
-       (insert-file-contents (gnus-agent-lib-file "flags"))
+       (nnheader-insert-file-contents (gnus-agent-lib-file "flags"))
        (if (null (gnus-check-server gnus-command-method))
            (message "Couldn't open server %s" (nth 1 gnus-command-method))
          (while (not (eobp))
@@ -483,8 +483,10 @@ Currently sends flag setting requests, if any."
 (defun gnus-agent-write-servers ()
   "Write the alist of covered servers."
   (gnus-make-directory (nnheader-concat gnus-agent-directory "lib"))
-  (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers")
-    (prin1 gnus-agent-covered-methods (current-buffer))))
+  (let ((coding-system-for-write nnheader-file-coding-system)
+       (file-name-coding-system nnmail-pathname-coding-system))
+    (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers")
+      (prin1 gnus-agent-covered-methods (current-buffer)))))
 
 ;;;
 ;;; Summary commands
@@ -591,7 +593,7 @@ the actual number of articles toggled is returned."
       (funcall function nil new)
       (gnus-agent-write-active file new)
       (erase-buffer)
-      (insert-file-contents-literally file))))
+      (nnheader-insert-file-contents file))))
 
 (defun gnus-agent-write-active (file new)
   (let ((orig (gnus-make-hashtable (count-lines (point-min) (point-max))))
@@ -599,7 +601,7 @@ the actual number of articles toggled is returned."
        elem osym)
     (when (file-exists-p file)
       (with-temp-buffer
-       (insert-file-contents file)
+       (nnheader-insert-file-contents file)
        (gnus-active-to-gnus-format nil orig))
       (mapatoms
        (lambda (sym)
@@ -621,10 +623,14 @@ the actual number of articles toggled is returned."
 (defun gnus-agent-save-group-info (method group active)
   (when (gnus-agent-method-p method)
     (let* ((gnus-command-method method)
+          (coding-system-for-write nnheader-file-coding-system)
+          (file-name-coding-system nnmail-pathname-coding-system)
           (file (gnus-agent-lib-file "active"))
           oactive)
       (gnus-make-directory (file-name-directory file))
       (with-temp-file file
+       ;; Emacs got problem to match non-ASCII group in multibyte buffer.
+       (mm-disable-multibyte) 
        (when (file-exists-p file)
          (nnheader-insert-file-contents file))
        (goto-char (point-min))
@@ -956,15 +962,16 @@ the actual number of articles toggled is returned."
 
 (defun gnus-agent-save-alist (group &optional articles state dir)
   "Save the article-state alist for GROUP."
-  (with-temp-file (if dir
-                     (concat dir ".agentview")
-                   (gnus-agent-article-name ".agentview" group))
-    (princ (setq gnus-agent-article-alist
-                (nconc gnus-agent-article-alist
-                       (mapcar (lambda (article) (cons article state))
-                               articles)))
-          (current-buffer))
-    (insert "\n")))
+  (let ((file-name-coding-system nnmail-pathname-coding-system))
+      (with-temp-file (if dir
+                         (concat dir ".agentview")
+                       (gnus-agent-article-name ".agentview" group))
+       (princ (setq gnus-agent-article-alist
+                    (nconc gnus-agent-article-alist
+                           (mapcar (lambda (article) (cons article state))
+                                   articles)))
+              (current-buffer))
+       (insert "\n"))))
 
 (defun gnus-agent-article-name (article group)
   (concat (gnus-agent-directory) (gnus-agent-group-path group) "/"
@@ -1448,7 +1455,7 @@ The following commands are available:
       (while (setq gnus-command-method (pop methods))
        (when (file-exists-p (gnus-agent-lib-file "active"))
          (with-temp-buffer
-           (insert-file-contents (gnus-agent-lib-file "active"))
+           (nnheader-insert-file-contents (gnus-agent-lib-file "active"))
            (gnus-active-to-gnus-format 
             gnus-command-method
             (setq orig (gnus-make-hashtable
index 0432cf5..05965aa 100644 (file)
@@ -584,7 +584,7 @@ $ emacs -batch -l ~/.emacs -l gnus -f gnus-jog-cache"
     ;; We simply read the active file.
     (save-excursion
       (gnus-set-work-buffer)
-      (insert-file-contents gnus-cache-active-file)
+      (nnheader-insert-file-contents gnus-cache-active-file)
       (gnus-active-to-gnus-format
        nil (setq gnus-cache-active-hashtb
                 (gnus-make-hashtable
index aad6822..7fdeab4 100644 (file)
@@ -2532,7 +2532,7 @@ If FORCE is non-nil, the .newsrc file is read."
        (while slave-files
          (erase-buffer)
          (setq file (nth 1 (car slave-files)))
-         (insert-file-contents file)
+         (nnheader-insert-file-contents file)
          (when (condition-case ()
                    (progn
                      (eval-buffer (current-buffer))
index 119209e..1ea7bc4 100644 (file)
@@ -7621,7 +7621,7 @@ latter case, they will be copied into the relevant groups."
     (save-excursion
       (set-buffer (gnus-get-buffer-create " *import file*"))
       (erase-buffer)
-      (insert-file-contents file)
+      (nnheader-insert-file-contents file)
       (goto-char (point-min))
       (unless (nnheader-article-p)
        ;; This doesn't look like an article, so we fudge some headers.
index 5293071..8c52b58 100644 (file)
@@ -539,9 +539,10 @@ Bind `print-quoted' and `print-readably' to t while printing."
 
 (defun gnus-make-directory (directory)
   "Make DIRECTORY (and all its parents) if it doesn't exist."
-  (when (and directory
-            (not (file-exists-p directory)))
-    (make-directory directory t))
+  (let ((file-name-coding-system nnmail-pathname-coding-system))
+    (when (and directory
+              (not (file-exists-p directory)))
+      (make-directory directory t)))
   t)
 
 (defun gnus-write-buffer (file)