* pgg-epg.el (pgg-epg-decrypt-region): Don't call
[elisp/epg.git] / epa.el
diff --git a/epa.el b/epa.el
index 2044980..b3b51e8 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -238,6 +238,14 @@ the separate window."
          (epg-sub-key-id (car (epg-key-sub-key-list
                                (widget-get widget :value))))))
 
+(if (fboundp 'encode-coding-string)
+    (defalias 'epa--encode-coding-string 'encode-coding-string)
+  (defalias 'epa--encode-coding-string 'identity))
+
+(if (fboundp 'decode-coding-string)
+    (defalias 'epa--decode-coding-string 'decode-coding-string)
+  (defalias 'epa--decode-coding-string 'identity))
+
 (defun epa-keys-mode ()
   "Major mode for `epa-list-keys'."
   (kill-all-local-variables)
@@ -693,7 +701,7 @@ Don't use this command in Lisp programs!"
       (message "Decrypting...done")
       (delete-region start end)
       (goto-char start)
-      (insert (decode-coding-string plain coding-system-for-read))
+      (insert (epg--decode-coding-string plain coding-system-for-read))
       (if (epg-context-result-for context 'verify)
          (epa-display-info (epg-verify-result-to-string
                             (epg-context-result-for context 'verify)))))))
@@ -736,7 +744,7 @@ Don't use this command in Lisp programs!"
     (epg-context-set-progress-callback context
                                       #'epa-progress-callback-function)
     (epg-verify-string context
-                      (encode-coding-string
+                      (epa--encode-coding-string
                        (buffer-substring start end)
                        coding-system-for-write))
     (if (epg-context-result-for context 'verify)
@@ -810,13 +818,13 @@ d - Create a detached signature
                                         #'epa-progress-callback-function)
       (message "Signing...")
       (setq signature (epg-sign-string context
-                                      (encode-coding-string
+                                      (epa--encode-coding-string
                                        (buffer-substring start end)
                                        coding-system-for-write)
                                       mode))
       (message "Signing...done")
       (delete-region start end)
-      (insert (decode-coding-string signature coding-system-for-read)))))
+      (insert (epg--decode-coding-string signature coding-system-for-read)))))
 
 ;;;###autoload
 (defun epa-encrypt-region (start end recipients)
@@ -838,7 +846,7 @@ If no one is selected, symmetric encryption will be performed.  ")))
                                         #'epa-progress-callback-function)
       (message "Encrypting...")
       (setq cipher (epg-encrypt-string context
-                                      (encode-coding-string
+                                      (epa--encode-coding-string
                                        (buffer-substring start end)
                                        coding-system-for-write)
                                       recipients))