Merge following changes from semi-1_14 branch:
authoryoichi <yoichi>
Fri, 23 Dec 2005 02:40:10 +0000 (02:40 +0000)
committeryoichi <yoichi>
Fri, 23 Dec 2005 02:40:10 +0000 (02:40 +0000)
2003-12-18  Daiki Ueno  <ueno@unixuser.org>

* pgg-gpg.el (pgg-gpg-process-region): Set environment variable
LANGUAGE as well.  GNU gettext gives precedence to LANGUAGE over
LC_ALL, when different language code is specified.  Thanks to
Tatsuya Kinoshita <tats@vega.ocn.ne.jp>.
[cf. <emacs-mime-ja:1599>]

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-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 ac7be86..a66865f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2003-12-18  Daiki Ueno  <ueno@unixuser.org>
+
+       * pgg-gpg.el (pgg-gpg-process-region): Set environment variable
+       LANGUAGE as well.  GNU gettext gives precedence to LANGUAGE over
+       LC_ALL, when different language code is specified.  Thanks to
+       Tatsuya Kinoshita <tats@vega.ocn.ne.jp>.
+       [cf. <emacs-mime-ja:1599>]
+
+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-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.
+
 2005-09-06  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mm-view.el (mime-view-insert-fontified-text-content): Disable
index ecdc0d3..7b4aa91 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 2e38bdd..c793816 100644 (file)
@@ -65,6 +65,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 6826184..104dad0 100644 (file)
@@ -48,6 +48,9 @@
 (defvar pgg-gpg-user-id nil
   "GnuPG ID of your default identity.")
 
+(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)
+      (setenv "LANGUAGE" 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:] ")
+       ;; XXX: copy contents of pgg-errors-buffer into
+       ;; pgg-output-buffer for backward compatibility.
+       (with-current-buffer pgg-output-buffer
+         (set-buffer-multibyte t)
+         (insert-buffer-substring pgg-errors-buffer))))))
 
 (luna-define-method pgg-scheme-insert-key ((scheme pgg-scheme-gpg))
   (let* ((user-id (or pgg-overriding-user-id pgg-gpg-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"))
+      ;; XXX: copy contents of pgg-errors-buffer into
+      ;; pgg-output-buffer for backward compatibility.
+      (with-current-buffer pgg-output-buffer
+       (set-buffer-multibyte t)
+       (insert-buffer-substring pgg-errors-buffer))
+      t)))
 
 (provide 'pgg-gpg)