* epa-file.el (epa-file-write-region): Don't attempt to write the
authorueno <ueno>
Wed, 20 Dec 2006 06:33:07 +0000 (06:33 +0000)
committerueno <ueno>
Wed, 20 Dec 2006 06:33:07 +0000 (06:33 +0000)
region to "/" to determine safe coding-system.

ChangeLog
epa-file.el

index aa4e5b3..a68579f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-12-20  Daiki Ueno  <ueno@unixuser.org>
 
+       * epa-file.el (epa-file-write-region): Don't attempt to write the
+       region to "/" to determine safe coding-system.
+
        * epa.el (epa-list-keys): Abolished PROTOCOL arg.
        (epa-sign-file): Save the output to *.p7s or *.p7m file if
        epa-protocol is CMS.
index f086f90..1f939c1 100644 (file)
@@ -164,10 +164,9 @@ May either be a string or a list of strings.")
       (error "Can't append to the file."))
   (setq file (expand-file-name file))
   (let* ((coding-system (or coding-system-for-write
-                           (if (boundp 'last-coding-system-used)
-                               (condition-case nil
-                                   (write-region (point-min) (point-max) "/")
-                                 (error last-coding-system-used))
+                           (if (fboundp 'select-safe-coding-system)
+                               (select-safe-coding-system
+                                (point-min) (point-max))
                              buffer-file-coding-system)))
         (context (epg-make-context))
         (coding-system-for-write 'binary)