From: ueno Date: Sun, 31 Dec 2006 11:12:43 +0000 (+0000) Subject: * epa.el (epa-encrypt-region): Take 4th argument SIGN. X-Git-Tag: epg-0_0_10~43 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=19b6cf73850091795f76fb553262cc6c29157df8;p=elisp%2Fepg.git * epa.el (epa-encrypt-region): Take 4th argument SIGN. (epa-encrypt): Ditto. --- diff --git a/ChangeLog b/ChangeLog index 1bfd2db..9d459e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ (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 diff --git a/epa.el b/epa.el index 1ab5908..e064e92 100644 --- a/epa.el +++ b/epa.el @@ -977,7 +977,7 @@ If no one is selected, default secret key is used. " (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!" @@ -990,7 +990,9 @@ 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) @@ -1008,7 +1010,7 @@ If no one is selected, symmetric encryption will be performed. ")))) (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) @@ -1024,7 +1026,7 @@ If no one is selected, symmetric encryption will be performed. ")))) '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!" @@ -1069,8 +1071,10 @@ If no one is selected, symmetric encryption will be performed. " (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)