(epa-sign-region): Query signature type at a time.
authorueno <ueno>
Wed, 22 Nov 2006 22:52:41 +0000 (22:52 +0000)
committerueno <ueno>
Wed, 22 Nov 2006 22:52:41 +0000 (22:52 +0000)
ChangeLog
epa.el

index 67b37e4..e2341d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-23  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa.el (epa-sign-region): Query signature type at a time.
+
 2006-11-22  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * epg.el (epg-context-set-passphrase-callback): Add optional
diff --git a/epa.el b/epa.el
index 9731a5f..8036040 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -757,10 +757,26 @@ Don't use this command in Lisp programs!"
         (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 ((or (eq c ?n) (eq c ?\n))
+                     (throw 'done nil))
+                    ((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
+"))))))))))
   (save-excursion
     (let ((context (epg-make-context))
          signature)