From: ueno Date: Thu, 21 Dec 2000 14:07:55 +0000 (+0000) Subject: 2000-12-21 Tadashi Watanabe X-Git-Tag: emiko-1_14-pgg-0_1-last-~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5731118495bb8c953b81cd5d7060024f16d33248;p=elisp%2Fsemi.git 2000-12-21 Tadashi Watanabe * pgg-gpg.el (pgg-scheme-verify-region): Use a "-" as the name for the file with the signed material. 2000-12-21 Daiki Ueno * pgg-def.el (pgg-messages-coding-system): New user option. * pgg-gpg.el (pgg-gpg-messages-coding-system): New variable. (pgg-gpg-process-region): Don't use `binary-start-process'; bind `coding-system-for-read' to `pgg-gpg-messages-coding-system'. --- diff --git a/pgg-def.el b/pgg-def.el index cb3fff8..d5f01b8 100644 --- a/pgg-def.el +++ b/pgg-def.el @@ -58,6 +58,11 @@ :group 'pgg :type 'boolean) +(defcustom pgg-messages-coding-system 'undecided + "Coding system used when reading from a PGP external process." + :group 'pgg + :type 'coding-system) + (defvar pgg-status-buffer " *PGG status*") (defvar pgg-errors-buffer " *PGG errors*") (defvar pgg-output-buffer " *PGG output*") diff --git a/pgg-gpg.el b/pgg-gpg.el index 0d5c833..d288082 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -47,6 +47,9 @@ (defvar pgg-gpg-user-id nil "GnuPG ID of your default identity.") +(defvar pgg-gpg-messages-coding-system pgg-messages-coding-system + "Coding system used when reading from a GnuPG external process.") + (defvar pgg-scheme-gpg-instance nil) ;;;###autoload @@ -74,9 +77,11 @@ (unwind-protect (progn (set-default-file-modes 448) - (setq process - (apply #'binary-start-process "*GnuPG*" errors-buffer - program args)) + (let ((coding-system-for-read 'pgg-gpg-messages-coding-system) + (coding-system-for-write 'binary)) + (setq process + (apply #'start-process "*GnuPG*" errors-buffer + program args))) (set-process-sentinel process #'ignore) (when passphrase (process-send-string process (concat passphrase "\n"))) @@ -186,6 +191,7 @@ (let ((args '("--batch" "--verify"))) (when (stringp signature) (setq args (append args (list signature)))) + (setq args (append args '("-"))) (pgg-gpg-process-region start end nil pgg-gpg-program args) (with-current-buffer pgg-errors-buffer (goto-char (point-min))