From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82769 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Arne_J=F8rgensen?= Newsgroups: gmane.emacs.gnus.general Subject: Re: Displaying picture from PGP key if present? Date: Thu, 27 Dec 2012 06:16:26 +0100 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: References: <87ehirwgjq.fsf@topper.koldfront.dk> <87ip7quzk3.fsf@gnus.org> <87mwx2s62p.fsf@topper.koldfront.dk> <87vcbqtk8q.fsf@gnus.org> <87ip7qs5fm.fsf@topper.koldfront.dk> <878v8mtjbg.fsf@gnus.org> <874njas1yf.fsf@topper.koldfront.dk> <87623qb5vl.fsf@gnus.org> <87sj6t7oe5.fsf@topper.koldfront.dk> <87obhhybna.fsf@topper.koldfront.dk> <87ip7py7mq.fsf@topper.koldfront.dk> <87d2xxy5t7.fsf@topper.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1356727585 12671 80.91.229.3 (28 Dec 2012 20:46:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2012 20:46:25 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M31035@lists.math.uh.edu Fri Dec 28 21:46:41 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TogpF-0004Si-3D for ding-account@gmane.org; Fri, 28 Dec 2012 21:46:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Togo1-0003qg-94; Fri, 28 Dec 2012 14:45:25 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1To5pu-00019L-Hg for ding@lists.math.uh.edu; Wed, 26 Dec 2012 23:16:54 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1To5pj-0004O2-7E for ding@lists.math.uh.edu; Wed, 26 Dec 2012 23:16:53 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1To5ph-0006Im-5v for ding@gnus.org; Thu, 27 Dec 2012 06:16:41 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1To5pu-0008HC-4i for ding@gnus.org; Thu, 27 Dec 2012 06:16:54 +0100 Original-Received: from 2.106.179.86 ([2.106.179.86]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Dec 2012 06:16:54 +0100 Original-Received: from arne by 2.106.179.86 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 27 Dec 2012 06:16:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 116 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 2.106.179.86 User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (darwin) Cancel-Lock: sha1:E/o51eIc5tHpANTBzTiWyfz7Q54= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82769 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable asjo@koldfront.dk (Adam Sj=F8gren) writes: > 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))))) Nice feature that I had to try immediately :-) For some reason it just did not work with my signature - i guess the =F8 in J=F8rgensen is to blame. Adding a "--display-charset utf-8" as parameter to gpg solved it. Patch attached and this posting signed as example. Kind regards, Arne --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=0001-mml2015.el-mml2015-epg-key-image-Use-display-charset.patch Content-Transfer-Encoding: quoted-printable Content-Description: mml2015.el (mml2015-epg-key-image): Use --display-charset utf-8 From=208742f96f9595fd526b35400a221ca7a81cf1b292 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Arne=3D20J=3DC3=3DB8rgensen?=3D Date: Thu, 27 Dec 2012 06:10:26 +0100 Subject: [PATCH] mml2015.el (mml2015-epg-key-image): Use --display-charset utf-8. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Arne J=F8rgensen =2D-- lisp/ChangeLog | 4 ++++ lisp/mml2015.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eafb422..00f843c 100644 =2D-- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-12-27 Arne J=F8rgensen + + * mml2015.el (mml2015-epg-key-image): Use --display-charset utf-8. + 2012-12-26 Katsumi Yamaoka =20 * mml2015.el (mml2015-epg-key-image): Use mm-set-buffer-multibyte. diff --git a/lisp/mml2015.el b/lisp/mml2015.el index 0bc83ad..a9121d5 100644 =2D-- a/lisp/mml2015.el +++ b/lisp/mml2015.el @@ -827,7 +827,7 @@ If set, it overrides the setting of `mml2015-sign-with-= sender'." (let* ((coding-system-for-write 'binary) (coding-system-for-read 'binary) (data (shell-command-to-string =2D (format "%s --list-options no-show-photos --attribute-= fd 2 --list-keys %s > /dev/null" + (format "%s --display-charset utf-8 --list-options no-sh= ow-photos --attribute-fd 2 --list-keys %s > /dev/null" epg-gpg-program key-id)))) (when (> (length data) 0) (insert (substring data 16)) =2D-=20 Arne J=F8rgensen --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Darwin) iQFHBAEBAgAxBQJQ29msKhSAAAAAABEAEHBrYS1hZGRyZXNzQGdudXBnYXJuZUBh cm5lc3RlZC5kawAKCRATl9t5IKsTqE77CACPdetqADEffg2zW3t2TTNoUCW0POTx 1LLaLZG0QAf5/YJHLt9IfaB6zCmAvIDVIZu+jl3HuADIVGiQFe9xKeo68ppdVbv2 c4LGEyrFgkIhSNC6m02DxDDJ3/64GrszYNMUOXkb1CcdMuVu55qvuQG0xjFQm0kb qukiC9M+4FLm9mK9BBv3+rBQxUa7s8Pig+vWcc+TNZ5yZmiHOlSTnOEsucQEaSXb KPWCYBDaJWrpFn7kO9ptUp3ASsOR6V/coD/bvIF8K24j0k58gZxQWPlLsTIKiDN2 xFKs6kxS6TZKBEjubf7oOpEeQweXNGD2pXEQTNzK0JOsfS13fvbqR4NX =fAWS -----END PGP SIGNATURE----- --==-=-=--