OSDN Git Service

(epa-sign-file): Query signature type at a time.
authorDaiki Ueno <ueno@unixuser.org>
Sat, 25 Nov 2006 22:57:43 +0000 (22:57 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Sat, 25 Nov 2006 22:57:43 +0000 (22:57 +0000)
ChangeLog
epa.el

index 3adb5a4..5902a9d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-26  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa.el (epa-sign-file): Query signature type at a time.
+
 2006-11-25  Daiki Ueno  <ueno@unixuser.org>
 
        * epa.el (epa-keys-mode): Don't call widget-setup.
diff --git a/epa.el b/epa.el
index 4ef4094..d105cb7 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -614,10 +614,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))))