"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
(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)