From: ueno Date: Fri, 5 Nov 1999 22:11:10 +0000 (+0000) Subject: * pgg-pgp.el (sign-region): Fix regexp for the beginning of armor. X-Git-Tag: emiko-1_13_7~48 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=eb546098df0c0a9079f4778d3776ee81a6eecf46;p=elisp%2Fsemi.git * pgg-pgp.el (sign-region): Fix regexp for the beginning of armor. * pgg-gpg.el (encrypt-region): Don't use "--textmode" in GPG arguments, replace line break code with CRLF while signing instead. --- diff --git a/pgg-gpg.el b/pgg-gpg.el index a879e9f..c98504e 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -157,15 +157,28 @@ (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)))))) @@ -198,7 +211,9 @@ (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))) diff --git a/pgg-pgp.el b/pgg-pgp.el index 927c0b5..b66e5b8 100644 --- a/pgg-pgp.el +++ b/pgg-pgp.el @@ -196,9 +196,7 @@ 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)