Handle gpg errors better when trying to display PGP key image.
[gnus] / lisp / mml2015.el
index d39ce28..f8f0a56 100644 (file)
@@ -823,11 +823,11 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
 (defun mml2015-epg-key-image (key-id)
   "Return the image of a key, if any"
   (with-temp-buffer
-    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
+    (mm-set-buffer-multibyte nil)
     (let* ((coding-system-for-write 'binary)
            (coding-system-for-read 'binary)
            (data (shell-command-to-string
-                  (format "%s --list-options no-show-photos --attribute-fd 2 --list-keys %s > /dev/null"
+                  (format "%s --list-options no-show-photos --attribute-fd 3 --list-keys %s 3>&1 >/dev/null 2>&1"
                           epg-gpg-program key-id))))
       (when (> (length data) 0)
         (insert (substring data 16))