* pgg-gpg.el (pgg-gpg-messages-locale): New user option.
authorueno <ueno>
Wed, 17 Dec 2003 05:12:32 +0000 (05:12 +0000)
committerueno <ueno>
Wed, 17 Dec 2003 05:12:32 +0000 (05:12 +0000)
(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.

ChangeLog
mime-pgp.el
pgg-def.el
pgg-gpg.el

index adcf613..4e5f1f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2003-12-17  Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <yamaoka@jpl.org>
 
        * mime-edit.el (mime-edit-normalize-body): Don't use the
index 187e4ec..4de3f67 100644 (file)
                   (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)
          (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))))
 
 
     (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
index 7630f95..a32dd24 100644 (file)
@@ -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*")
index 32c59df..1b24cdd 100644 (file)
@@ -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
         (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))
       (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))
                         (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)