* pgg.el (pgg-encrypt-region): Support sign.
authorSimon Josefsson <jas@extundo.com>
Thu, 3 Oct 2002 23:46:25 +0000 (23:46 +0000)
committerSimon Josefsson <jas@extundo.com>
Thu, 3 Oct 2002 23:46:25 +0000 (23:46 +0000)
* pgg-gpg.el (pgg-gpg-encrypt-region): Ditto.

* mml2015.el (mml2015-pgg-encrypt): Ditto.

lisp/ChangeLog
lisp/mml2015.el
lisp/pgg-gpg.el
lisp/pgg.el

index 764ea34..0396f86 100644 (file)
@@ -1,5 +1,11 @@
 2002-10-04  Simon Josefsson  <jas@extundo.com>
 
+       * pgg.el (pgg-encrypt-region): Support sign.
+
+       * pgg-gpg.el (pgg-gpg-encrypt-region): Ditto.
+
+       * mml2015.el (mml2015-pgg-encrypt): Ditto.
+
        * pgg.el, pgg-def.el, pgg-parse.el, pgg-gpg.el, pgg-pgp5.el,
        pgg-pgp6.el: Moved from ../pgg/.  Modifications compared to EMIKO
        branch where PGG was taken from in the ChangeLog entries below.
index 846ddd0..7e8cb28 100644 (file)
@@ -817,7 +817,8 @@ by you.")
                                  (message-options-get 'message-recipients)
                                  (message-options-set 'message-recipients
                                                       (read-string "Recipients: ")))
-                                "[ \f\t\n\r\v,]+"))
+                                "[ \f\t\n\r\v,]+")
+                               sign)
       (pop-to-buffer mml2015-result-buffer)
       (error "Encrypt error"))
     (delete-region (point-min) (point-max))
index 4c347c2..8c828d2 100644 (file)
                                     (progn (end-of-line)(point)))
                   ":")) 8)))))
 
-(defun pgg-gpg-encrypt-region (start end recipients)
-  "Encrypt the current region between START and END."
+(defun pgg-gpg-encrypt-region (start end recipients &optional sign)
+  "Encrypt the current region between START and END.
+If optional argument SIGN is non-nil, do a combined sign and encrypt."
   (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id))
         (args
-         `("--batch" "--armor" "--always-trust" "--encrypt"
+         `("--batch" "--armor" "--always-trust"
+           (if sign "--sign --encrypt" "--encrypt")
            ,@(if recipients
                  (apply #'nconc
                         (mapcar (lambda (rcpt)
index 536da3b..54b106a 100644 (file)
 ;;;
 
 ;;;###autoload
-(defun pgg-encrypt-region (start end rcpts)
-  "Encrypt the current region between START and END for RCPTS."
+(defun pgg-encrypt-region (start end rcpts &optional sign)
+  "Encrypt the current region between START and END for RCPTS.
+If optional argument SIGN is non-nil, do a combined sign and encrypt."
   (interactive
    (list (region-beginning)(region-end)
         (split-string (read-string "Recipients: ") "[ \t,]+")))
   (let ((status
         (pgg-save-coding-system start end
           (pgg-invoke "encrypt-region" (or pgg-scheme pgg-default-scheme)
-                      (point-min) (point-max) rcpts))))
+                      (point-min) (point-max) rcpts sign))))
     (when (interactive-p)
       (pgg-display-output-buffer start end status))
     status))