(epa-decrypt-file): Display output file name on completion.
[elisp/epg.git] / epa.el
diff --git a/epa.el b/epa.el
index 4ef4094..2044980 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -584,7 +584,8 @@ If SECRET is non-nil, list secret keys instead of public keys."
                                       #'epa-progress-callback-function)
     (message "Decrypting %s..." (file-name-nondirectory file))
     (epg-decrypt-file context file plain)
-    (message "Decrypting %s...done" (file-name-nondirectory file))
+    (message "Decrypting %s...wrote %s" (file-name-nondirectory file)
+            (file-name-nondirectory plain))
     (if (epg-context-result-for context 'verify)
        (epa-display-info (epg-verify-result-to-string
                           (epg-context-result-for context 'verify))))))
@@ -614,10 +615,26 @@ If SECRET is non-nil, list secret keys instead of public keys."
         (epa-select-keys (epg-make-context) "Select keys for signing.
 If no one is selected, default secret key is used.  "
                          nil t)
-        (if (y-or-n-p "Make a detached signature? ")
-            'detached
-          (if (y-or-n-p "Make a cleartext signature? ")
-              'clear))))
+        (catch 'done
+          (while t
+            (message "Signature type (n,c,d,?) ")
+            (let ((c (read-char)))
+              (cond ((eq c ?c)
+                     (throw 'done 'clear))
+                    ((eq c ?d)
+                     (throw 'done 'detached))
+                    ((eq c ??)
+                     (with-output-to-temp-buffer "*Help*"
+                       (save-excursion
+                         (set-buffer standard-output)
+                         (insert "\
+n - Create a normal signature
+c - Create a cleartext signature
+d - Create a detached signature
+? - Show this help
+"))))
+                    (t
+                     (throw 'done nil))))))))
   (let ((signature (concat file
                           (if (or epa-armor
                                   (not (memq mode '(nil t normal detached))))
@@ -635,7 +652,8 @@ If no one is selected, default secret key is used.  "
                                       #'epa-progress-callback-function)
     (message "Signing %s..." (file-name-nondirectory file))
     (epg-sign-file context file signature mode)
-    (message "Signing %s...done" (file-name-nondirectory file))))
+    (message "Signing %s...wrote %s" (file-name-nondirectory file)
+            (file-name-nondirectory signature))))
 
 ;;;###autoload
 (defun epa-encrypt-file (file recipients)
@@ -654,7 +672,8 @@ If no one is selected, symmetric encryption will be performed.  ")))
                                       #'epa-progress-callback-function)
     (message "Encrypting %s..." (file-name-nondirectory file))
     (epg-encrypt-file context file recipients cipher)
-    (message "Encrypting %s...done" (file-name-nondirectory file))))
+    (message "Encrypting %s...wrote %s" (file-name-nondirectory file)
+            (file-name-nondirectory cipher))))
 
 ;;;###autoload
 (defun epa-decrypt-region (start end)