* EasyPG: Version 0.0.12 released.
[elisp/epg.git] / epa-file.el
index 9828b65..898a4e9 100644 (file)
@@ -84,13 +84,15 @@ May either be a string or a list of strings.")
 
 (defvar epa-file-passphrase-alist nil)
 
-(if (fboundp 'encode-coding-string)
-    (defalias 'epa-file--encode-coding-string 'encode-coding-string)
-  (defalias 'epa-file--encode-coding-string 'identity))
+(eval-and-compile
+  (if (fboundp 'encode-coding-string)
+      (defalias 'epa-file--encode-coding-string 'encode-coding-string)
+    (defalias 'epa-file--encode-coding-string 'identity)))
 
-(if (fboundp 'decode-coding-string)
-    (defalias 'epa-file--decode-coding-string 'decode-coding-string)
-  (defalias 'epa-file--decode-coding-string 'identity))
+(eval-and-compile
+  (if (fboundp 'decode-coding-string)
+      (defalias 'epa-file--decode-coding-string 'decode-coding-string)
+    (defalias 'epa-file--decode-coding-string 'identity)))
 
 (defun epa-file-name-regexp-update ()
   (interactive)
@@ -218,6 +220,8 @@ May either be a string or a list of strings.")
           file))
     (epg-context-set-progress-callback context
                                       #'epa-progress-callback-function)
+    (epg-context-set-armor context epa-armor)
+    (epg-context-set-textmode context epa-textmode)
     (condition-case error
        (setq string
              (epg-encrypt-string
@@ -270,7 +274,7 @@ If no one is selected, symmetric encryption will be performed.  "
   (make-local-variable 'epa-file-encrypt-to)
   (setq epa-file-encrypt-to
        (epa-select-keys
-        context
+        (epg-make-context)
         "Select recipents for encryption.
 If no one is selected, symmetric encryption will be performed.  ")))