(epa--find-coding-system-for-mime-charset): New function.
(epa-decrypt-armor-in-region): Use it.
(epa-progress-callback-function): Use handback as the prompt.
+ (epa-encrypt-region): Take 4th argument SIGN.
+ (epa-encrypt): Ditto.
2006-12-31 Daiki Ueno <ueno@unixuser.org>
(epa-sign-region start end signers mode))
;;;###autoload
-(defun epa-encrypt-region (start end recipients)
+(defun epa-encrypt-region (start end recipients sign)
"Encrypt the current region between START and END for RECIPIENTS.
Don't use this command in Lisp programs!"
(list (region-beginning) (region-end)
(epa-select-keys (epg-make-context epa-protocol)
"Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "))))
+If no one is selected, symmetric encryption will be performed. ")
+ (if current-prefix-arg
+ (y-or-n-p "Sign? ")))))
(save-excursion
(let ((context (epg-make-context epa-protocol))
cipher)
(epa--encode-coding-string
(buffer-substring start end)
epa-last-coding-system-specified)
- recipients))
+ recipients sign))
(message "Encrypting...done")
(delete-region start end)
(goto-char start)
'end-open t)))))
;;;###autoload
-(defun epa-encrypt (start end recipients)
+(defun epa-encrypt (start end recipients sign)
"Encrypt the current buffer.
Don't use this command in Lisp programs!"
(epg-list-keys
(epg-make-context epa-protocol)
(concat "<" recipient ">")))
- recipients)))))))))
- (epa-encrypt-region start end recipients))
+ recipients)))))
+ (if current-prefix-arg
+ (y-or-n-p "Sign? "))))))
+ (epa-encrypt-region start end recipients sign))
;;;###autoload
(defun epa-delete-keys (keys &optional allow-secret)