On Wed, Dec 26 2012, Adam Sjøgren wrote: > On Wed, 26 Dec 2012 01:33:33 +0100, Adam wrote: > >> So, I'm kind of stuck on that. > > Skipping the first 16 bytes and using a non-multibyte buffer on the way > makes it work with --attribute-fd: > > (defun epg-key-image (key-id) > "Return the image of a key, if any" > (with-temp-buffer > (set-buffer-multibyte nil) > (let* ((coding-system-for-write 'binary) > (coding-system-for-read 'binary) > (data (shell-command-to-string (concat epg-gpg-program > " --attribute-fd 2" > " --list-keys " key-id " >/dev/null")))) > (when (> (length data) 0) > (insert (substring data 16)) > (create-image (buffer-string) nil t))))) The following change is needed otherwise I get error reading my mail: diff --git a/lisp/mml2015.el b/lisp/mml2015.el index 0bc83ad..19c55f9 100644 --- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -829,7 +829,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (data (shell-command-to-string (format "%s --list-options no-show-photos --attribute-fd 2 --list-keys %s > /dev/null" epg-gpg-program key-id)))) - (when (> (length data) 0) + (when (and (> (length data) 0) + (not (string-match "^gpg: error reading key: public key not found$" data))) (insert (substring data 16)) (create-image (buffer-string) nil t))))) I'll install it unless you have a better fix. -- Julien Danjou // Free Software hacker & freelance // http://julien.danjou.info