From: ueno Date: Thu, 28 Dec 2006 06:56:10 +0000 (+0000) Subject: * epa.el (epa-sign-file): Ask signing key only when a prefix arg X-Git-Tag: epg-0_0_9~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=3c2adedccd35d5fb8ccb7df8768922fee6024d1e;p=elisp%2Fepg.git * 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. --- diff --git a/ChangeLog b/ChangeLog index dc3eb4a..7c910dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-12-28 Daiki Ueno + + * 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 * epg-config.el (epg-passphrase-coding-system): Default to nil. diff --git a/epa.el b/epa.el index 2dab9a1..a150b16 100644 --- 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)