OSDN Git Service

* epa.el (epa-sign-file): Ask signing key only when a prefix arg
authorDaiki Ueno <ueno@unixuser.org>
Thu, 28 Dec 2006 06:56:10 +0000 (06:56 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Thu, 28 Dec 2006 06:56:10 +0000 (06:56 +0000)
is given; ask signature type only when a prefix arg is given.
(epa-sign-region): Ditto.

ChangeLog
epa.el

index dc3eb4a..7c910dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-28  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa.el (epa-sign-file): Ask signing key only when a prefix arg
+       is given; ask signature type only when a prefix arg is given.
+       (epa-sign-region): Ditto.
+
 2006-12-26  Daiki Ueno  <ueno@unixuser.org>
 
        * epg-config.el (epg-passphrase-coding-system): Default to nil.
diff --git a/epa.el b/epa.el
index 2dab9a1..a150b16 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -647,30 +647,33 @@ If SECRET is non-nil, list secret keys instead of public keys."
   "Sign FILE by SIGNERS keys selected."
   (interactive
    (list (expand-file-name (read-file-name "File: "))
-        (epa-select-keys (epg-make-context epa-protocol)
-                         "Select keys for signing.
+        (if current-prefix-arg
+            (epa-select-keys (epg-make-context epa-protocol)
+                             "Select keys for signing.
 If no one is selected, default secret key is used.  "
-                         nil t)
-        (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 "\
+                             nil t))
+        (if current-prefix-arg
+            (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))))))))
+                        (t
+                         (throw 'done nil)))))))
+        'clear))
   (let ((signature (concat file
                           (if (eq epa-protocol 'OpenPGP)
                               (if (or epa-armor
@@ -834,30 +837,33 @@ Don't use this command in Lisp programs!"
               (epa--select-safe-coding-system
                (region-beginning) (region-end))))
      (list (region-beginning) (region-end)
-          (epa-select-keys (epg-make-context epa-protocol)
-                           "Select keys for signing.
+          (if current-prefix-arg
+              (epa-select-keys (epg-make-context epa-protocol)
+                               "Select keys for signing.
 If no one is selected, default secret key is used.  "
-                           nil t)
-          (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 "\
+                               nil t))
+          (if current-prefix-arg
+              (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)))))))))
+                          (t
+                           (throw 'done nil)))))))
+          'clear)))
   (save-excursion
     (let ((context (epg-make-context epa-protocol))
          signature)