* pgg-pgp.el (sign-region): Fix regexp for the beginning of armor.
authorueno <ueno>
Fri, 5 Nov 1999 22:11:10 +0000 (22:11 +0000)
committerueno <ueno>
Fri, 5 Nov 1999 22:11:10 +0000 (22:11 +0000)
* pgg-gpg.el (encrypt-region): Don't use "--textmode" in GPG
arguments, replace line break code with CRLF while signing
instead.

pgg-gpg.el
pgg-pgp.el

index a879e9f..c98504e 100644 (file)
           (luna-send scheme 'lookup-key-string
                      scheme pgg-gpg-user-id 'encrypt)))
         (args 
-         `("--batch" "--armor" "--textmode" "--always-trust" "--encrypt"
+         `("--batch" "--armor" "--always-trust" "--encrypt"
            ,@(if recipients
                  (apply #'append 
                         (mapcar (lambda (rcpt) 
                                   (list "--remote-user" 
                                         (concat "\"" rcpt "\""))) 
-                                recipients))))))
+                                recipients)))))
+        (inhibit-read-only t)
+        buffer-read-only)
+    (goto-char start)
+    (setq end (set-marker (make-marker) (point-max)))
+    (while (progn (end-of-line) (> (marker-position end) (point)))
+      (insert "\r")
+      (forward-line 1))
     (pgg-gpg-process-region start end passphrase pgg-gpg-program args)
+    (goto-char start)
+    (while (re-search-forward "\r$" end t)
+      (replace-match ""))
     (pgg-process-when-success
+      (goto-char (point-min))
+      (while (re-search-forward "\r$" nil t)
+       (replace-match ""))
       (let ((packet 
             (cdr (assq 1 (pgg-parse-armor-region 
                           (point-min)(point-max))))))
         (args 
          (list (if cleartext "--clearsign" "--detach-sign")
                "--armor" "--batch" "--verbose" 
-               "--local-user" pgg-gpg-user-id)))
+               "--local-user" pgg-gpg-user-id))
+        (inhibit-read-only t)
+        buffer-read-only)
     (goto-char start)
     (setq end (set-marker (make-marker) (point-max)))
     (while (progn (end-of-line) (> (marker-position end) (point)))
index 927c0b5..b66e5b8 100644 (file)
                             pgg-pgp-program args)
     (pgg-process-when-success
       (goto-char (point-min))
-      (while (re-search-forward "\r$" nil t)
-       (replace-match ""))
-      (when (re-search-forward "^-+BEGIN PGP SIGNATURE" nil t);XXX
+      (when (re-search-forward "^-+BEGIN PGP" nil t);XXX
        (let ((packet 
               (cdr (assq 2 (pgg-parse-armor-region 
                             (progn (beginning-of-line 2)