From: ueno Date: Wed, 17 Dec 2003 05:12:32 +0000 (+0000) Subject: * pgg-gpg.el (pgg-gpg-messages-locale): New user option. X-Git-Tag: semi-1_14_6~4 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e462efc3af1522d39aed42eb0bbbdb50bd4c303f;p=elisp%2Fsemi.git * pgg-gpg.el (pgg-gpg-messages-locale): New user option. (pgg-gpg-process-region): Set environment variable LC_ALL when pgg-gpg-messages-locale is specified. (pgg-scheme-verify-region): Don't copy messages from pgg-errors-buffer to pgg-output-buffer. (pgg-scheme-snarf-keys-region): Ditto. * pgg-def.el (pgg-messages-locale): New user option. * mime-pgp.el (mime-verify-application/pgp-signature): Copy messages from pgg-errors-buffer. (mime-add-application/pgp-keys): Ditto. --- diff --git a/ChangeLog b/ChangeLog index adcf613..4e5f1f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2003-12-17 Daiki Ueno + + * pgg-gpg.el (pgg-gpg-messages-locale): New user option. + (pgg-gpg-process-region): Set environment variable LC_ALL when + pgg-gpg-messages-locale is specified. + (pgg-scheme-verify-region): Don't copy messages from + pgg-errors-buffer to pgg-output-buffer. + (pgg-scheme-snarf-keys-region): Ditto. + + * pgg-def.el (pgg-messages-locale): New user option. + + * mime-pgp.el (mime-verify-application/pgp-signature): Copy + messages from pgg-errors-buffer. + (mime-add-application/pgp-keys): Ditto. + 2003-12-16 Katsumi Yamaoka * mime-edit.el (mime-edit-normalize-body): Don't use the diff --git a/mime-pgp.el b/mime-pgp.el index 187e4ec..4de3f67 100644 --- a/mime-pgp.el +++ b/mime-pgp.el @@ -141,8 +141,7 @@ (1- knum) (1+ knum))) (orig-entity (nth onum (mime-entity-children mother))) - (sig-file (make-temp-file "tm" nil ".asc")) - status) + (sig-file (make-temp-file "tm" nil ".asc"))) (save-excursion (mime-show-echo-buffer) (set-buffer mime-echo-buffer-name) @@ -157,12 +156,11 @@ (while (progn (end-of-line) (not (eobp))) (insert "\r") (forward-line 1)) - (setq status (pgg-verify-region (point-min)(point-max) - sig-file 'fetch)) + (pgg-verify-region (point-min)(point-max) + sig-file 'fetch) (save-excursion (set-buffer mime-echo-buffer-name) - (insert-buffer-substring (if status pgg-output-buffer - pgg-errors-buffer)))) + (insert-buffer-substring pgg-errors-buffer))) (delete-file sig-file)))) @@ -198,11 +196,10 @@ (mime-insert-entity-content entity) (mime-decode-region (point-min) (point-max) (cdr (assq 'encoding situation))) - (let ((status (pgg-snarf-keys-region (point-min)(point-max)))) - (save-excursion - (set-buffer mime-echo-buffer-name) - (insert-buffer-substring (if status pgg-output-buffer - pgg-errors-buffer)))))) + (pgg-snarf-keys-region (point-min)(point-max)) + (save-excursion + (set-buffer mime-echo-buffer-name) + (insert-buffer-substring pgg-errors-buffer)))) ;;; @ Internal method for application/pkcs7-signature diff --git a/pgg-def.el b/pgg-def.el index 7630f95..a32dd24 100644 --- a/pgg-def.el +++ b/pgg-def.el @@ -61,6 +61,9 @@ (defvar pgg-messages-coding-system nil "Coding system used when reading from a PGP external process.") +(defvar pgg-messages-locale nil + "Locale set before running a PGP external process.") + (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 32c59df..1b24cdd 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -51,6 +51,9 @@ (defvar pgg-gpg-messages-coding-system pgg-messages-coding-system "Coding system used when reading from a GnuPG external process.") +(defvar pgg-gpg-messages-locale pgg-messages-locale + "Locale set before running a GnuPG external process.") + (defvar pgg-scheme-gpg-instance nil) ;;;###autoload @@ -72,7 +75,11 @@ (output-buffer pgg-output-buffer) (errors-buffer pgg-errors-buffer) (process-connection-type nil) + (process-environment process-environment) process status exit-status) + (when pgg-gpg-messages-locale + (setq process-environment (copy-sequence process-environment)) + (setenv "LC_ALL" pgg-gpg-messages-locale)) (with-current-buffer (get-buffer-create errors-buffer) (buffer-disable-undo) (erase-buffer)) @@ -200,9 +207,7 @@ (goto-char (point-min)) (prog1 (re-search-forward "^\\[GNUPG:] GOODSIG\\>" nil t) (goto-char (point-min)) - (delete-matching-lines "^warning\\|\\[GNUPG:]") - (set-buffer pgg-output-buffer) - (insert-buffer-substring pgg-errors-buffer))))) + (delete-matching-lines "^\\[GNUPG:] "))))) (luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-gpg)) (let* ((pgg-gpg-user-id (or pgg-gpg-user-id pgg-default-user-id)) @@ -232,9 +237,9 @@ (aref status 11))) (if (zerop (aref status 9)) "" - "\tSecret keys are imported.\n"))) - (append-to-buffer pgg-output-buffer (point-min)(point-max)) - (pgg-process-when-success))) + "\tSecret keys are imported.\n")) + (append-to-buffer pgg-errors-buffer (point-min)(point-max)) + t))) (provide 'pgg-gpg)