This commit was generated by cvs2svn to compensate for changes in r3968,
[elisp/gnus.git-] / lisp / nnmail.el
index c557fa2..8e8359e 100644 (file)
@@ -493,9 +493,9 @@ parameter.  It should return nil, `warn' or `delete'."
   (let ((format-alist nil)
         (after-insert-file-functions nil))
     (condition-case ()
-       (let ((coding-system-for-read nnmail-file-coding-system)
-             (pathname-coding-system 'binary))
-         (insert-file-contents file)
+       (let ((pathname-coding-system 'binary))
+         (insert-file-contents-as-coding-system
+          nnmail-file-coding-system file)
          t)
       (file-error nil))))
 
@@ -1684,11 +1684,13 @@ If ARGS, PROMPT is used as an argument to `format'."
             (apply 'format prompt args)
           prompt)))
     (unless nnmail-read-passwd
-      (if (load "passwd" t)
+      (if (functionp 'read-passwd)
          (setq nnmail-read-passwd 'read-passwd)
-       (unless (fboundp 'ange-ftp-read-passwd)
-         (autoload 'ange-ftp-read-passwd "ange-ftp"))
-       (setq nnmail-read-passwd 'ange-ftp-read-passwd)))
+       (if (load "passwd" t)
+           (setq nnmail-read-passwd 'read-passwd)
+         (unless (fboundp 'ange-ftp-read-passwd)
+           (autoload 'ange-ftp-read-passwd "ange-ftp"))
+         (setq nnmail-read-passwd 'ange-ftp-read-passwd))))
     (funcall nnmail-read-passwd prompt)))
 
 (defun nnmail-check-syntax ()
@@ -1701,9 +1703,9 @@ If ARGS, PROMPT is used as an argument to `format'."
 
 (defun nnmail-write-region (start end filename &optional append visit lockname)
   "Do a `write-region', and then set the file modes."
-  (let ((coding-system-for-write nnmail-file-coding-system)
-       (pathname-coding-system 'binary))
-    (write-region start end filename append visit lockname)
+  (let ((pathname-coding-system 'binary))
+    (write-region-as-coding-system
+     nnmail-file-coding-system start end filename append visit lockname)
     (set-file-modes filename nnmail-default-file-modes)))
 
 ;;;