Sync up with chao-6_9.
[elisp/gnus.git-] / lisp / gnus-start.el
index 5b9d98a..1d1260d 100644 (file)
@@ -386,9 +386,6 @@ Can be used to turn version control on or off."
   :group 'gnus-newsrc
   :type 'boolean)
 
-(defvar gnus-startup-file-coding-system 'binary
-  "*Coding system for startup file.")
-
 ;;; Internal variables
 
 (defvar gnus-newsrc-file-version nil)
@@ -427,9 +424,7 @@ Can be used to turn version control on or off."
                   (file-exists-p (concat file ".el"))
                   (file-exists-p (concat file ".elc")))
               (condition-case var
-                  (let ((coding-system-for-read
-                         gnus-startup-file-coding-system))
-                    (load file nil t))
+                  (load file nil t)
                 (error
                  (error "Error in %s: %s" file var)))))))))
 
@@ -785,7 +780,7 @@ prompt the user for the name of an NNTP server to use."
       (erase-buffer)
       (setq buffer-file-name dribble-file)
       (auto-save-mode t)
-      (buffer-disable-undo)
+      (buffer-disable-undo (current-buffer))
       (bury-buffer (current-buffer))
       (set-buffer-modified-p nil)
       (let ((auto (make-auto-save-file-name))
@@ -1877,7 +1872,7 @@ If FORCE is non-nil, the .newsrc file is read."
        (save-excursion
          (gnus-message 5 "Reading %s..." newsrc-file)
          (set-buffer (nnheader-find-file-noselect newsrc-file))
-         (buffer-disable-undo)
+         (buffer-disable-undo (current-buffer))
          (gnus-newsrc-to-gnus-format)
          (kill-buffer (current-buffer))
          (gnus-message 5 "Reading %s...done" newsrc-file)))
@@ -1917,8 +1912,7 @@ If FORCE is non-nil, the .newsrc file is read."
     (gnus-message 5 "Reading %s..." ding-file)
     (let (gnus-newsrc-assoc)
       (condition-case nil
-         (let ((coding-system-for-read gnus-startup-file-coding-system))
-           (load ding-file t t t))
+         (load ding-file t t t)
        (error
         (ding)
         (unless (gnus-yes-or-no-p
@@ -2274,13 +2268,12 @@ If FORCE is non-nil, the .newsrc file is read."
          (setq buffer-file-name
                (concat gnus-current-startup-file ".eld"))
          (setq default-directory (file-name-directory buffer-file-name))
-         (buffer-disable-undo)
+         (buffer-disable-undo (current-buffer))
          (erase-buffer)
          (gnus-message 5 "Saving %s.eld..." gnus-current-startup-file)
          (gnus-gnus-to-quick-newsrc-format)
          (gnus-run-hooks 'gnus-save-quick-newsrc-hook)
-         (let ((coding-system-for-write gnus-startup-file-coding-system))
-           (save-buffer))
+         (save-buffer)
          (kill-buffer (current-buffer))
          (gnus-message
           5 "Saving %s.eld...done" gnus-current-startup-file))
@@ -2338,7 +2331,7 @@ If FORCE is non-nil, the .newsrc file is read."
          info ranges range method)
       (setq buffer-file-name gnus-current-startup-file)
       (setq default-directory (file-name-directory buffer-file-name))
-      (buffer-disable-undo)
+      (buffer-disable-undo (current-buffer))
       (erase-buffer)
       ;; Write options.
       (when gnus-newsrc-options
@@ -2424,6 +2417,7 @@ If FORCE is non-nil, the .newsrc file is read."
       (gnus-message 7 "Reading slave newsrcs...")
       (save-excursion
        (set-buffer (gnus-get-buffer-create " *gnus slave*"))
+       (buffer-disable-undo (current-buffer))
        (setq slave-files
              (sort (mapcar (lambda (file)
                              (list (nth 5 (file-attributes file)) file))
@@ -2529,8 +2523,8 @@ If FORCE is non-nil, the .newsrc file is read."
                          enable-multibyte-characters
                          (fboundp 'gnus-mule-get-coding-system)
                          (gnus-mule-get-coding-system (symbol-name group)))))
-               (when coding
-                 (setq str (mm-decode-coding-string str (car coding))))
+               (if coding
+                   (setq str (gnus-decode-coding-string str (car coding))))
                (set group str)))
            (forward-line 1))))
       (gnus-message 5 "Reading descriptions file...done")