Fixed.
[elisp/epg.git] / epa.el
diff --git a/epa.el b/epa.el
index e064e92..40cc0ab 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -682,15 +682,16 @@ d - Create a detached signature
 (defun epa-sign-file (file signers mode)
   "Sign FILE by SIGNERS keys selected."
   (interactive
-   (list (expand-file-name (read-file-name "File: "))
-        (if current-prefix-arg
-            (epa-select-keys (epg-make-context epa-protocol)
-                             "Select keys for signing.
+   (let ((verbose current-prefix-arg))
+     (list (expand-file-name (read-file-name "File: "))
+          (if verbose
+              (epa-select-keys (epg-make-context epa-protocol)
+                               "Select keys for signing.
 If no one is selected, default secret key is used.  "
-                             nil t))
-        (if current-prefix-arg
-            (epa--read-signature-type)
-          'clear)))
+                               nil t))
+          (if verbose
+              (epa--read-signature-type)
+            'clear))))
   (let ((signature (concat file
                           (if (eq epa-protocol 'OpenPGP)
                               (if (or epa-armor
@@ -884,18 +885,18 @@ Don't use this command in Lisp programs!"
 
 Don't use this command in Lisp programs!"
   (interactive
-   (progn
+   (let ((verbose current-prefix-arg))
      (setq epa-last-coding-system-specified
           (or coding-system-for-write
               (epa--select-safe-coding-system
                (region-beginning) (region-end))))
      (list (region-beginning) (region-end)
-          (if current-prefix-arg
+          (if verbose
               (epa-select-keys (epg-make-context epa-protocol)
                                "Select keys for signing.
 If no one is selected, default secret key is used.  "
                                nil t))
-          (if current-prefix-arg
+          (if verbose
               (epa--read-signature-type)
             'clear))))
   (save-excursion
@@ -965,19 +966,20 @@ Don't use this command in Lisp programs!"
      (setq epa-last-coding-system-specified
           (or coding-system-for-write
               (epa--select-safe-coding-system (point) (point-max))))
-     (list (point) (point-max)
-          (if current-prefix-arg
-              (epa-select-keys (epg-make-context epa-protocol)
-                               "Select keys for signing.
+     (let ((verbose current-prefix-arg))
+       (list (point) (point-max)
+            (if verbose
+                (epa-select-keys (epg-make-context epa-protocol)
+                                 "Select keys for signing.
 If no one is selected, default secret key is used.  "
-                               nil t))
-          (if current-prefix-arg
-              (epa--read-signature-type)
-            'clear))))
+                                 nil t))
+            (if verbose
+                (epa--read-signature-type)
+              'clear)))))
   (epa-sign-region start end signers mode))
 
 ;;;###autoload
-(defun epa-encrypt-region (start end recipients sign)
+(defun epa-encrypt-region (start end recipients)
   "Encrypt the current region between START and END for RECIPIENTS.
 
 Don't use this command in Lisp programs!"
@@ -990,9 +992,7 @@ Don't use this command in Lisp programs!"
      (list (region-beginning) (region-end)
           (epa-select-keys (epg-make-context epa-protocol)
                            "Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed.  ")
-          (if current-prefix-arg
-                (y-or-n-p "Sign? ")))))
+If no one is selected, symmetric encryption will be performed.  "))))
   (save-excursion
     (let ((context (epg-make-context epa-protocol))
          cipher)
@@ -1010,7 +1010,7 @@ If no one is selected, symmetric encryption will be performed.  ")
                                       (epa--encode-coding-string
                                        (buffer-substring start end)
                                        epa-last-coding-system-specified)
-                                      recipients sign))
+                                      recipients))
       (message "Encrypting...done")
       (delete-region start end)
       (goto-char start)
@@ -1026,7 +1026,7 @@ If no one is selected, symmetric encryption will be performed.  ")
                                 'end-open t)))))
 
 ;;;###autoload
-(defun epa-encrypt (start end recipients sign)
+(defun epa-encrypt (start end recipients)
   "Encrypt the current buffer.
 
 Don't use this command in Lisp programs!"
@@ -1071,10 +1071,8 @@ If no one is selected, symmetric encryption will be performed.  "
                                   (epg-list-keys
                                    (epg-make-context epa-protocol)
                                    (concat "<" recipient ">")))
-                                recipients)))))
-            (if current-prefix-arg
-                (y-or-n-p "Sign? "))))))
-  (epa-encrypt-region start end recipients sign))
+                                recipients)))))))))
+  (epa-encrypt-region start end recipients))
 
 ;;;###autoload
 (defun epa-delete-keys (keys &optional allow-secret)