Gnus development mailing list
 help / color / mirror / Atom feed
From: "Arne Jørgensen" <arne@arnested.dk>
To: ding@gnus.org
Subject: Re: Displaying picture from PGP key if present?
Date: Thu, 27 Dec 2012 06:16:26 +0100	[thread overview]
Message-ID: <m2a9t0krbp.fsf@arnested.dk> (raw)
In-Reply-To: <87d2xxy5t7.fsf@topper.koldfront.dk>


[-- Attachment #1.1: Type: text/plain, Size: 1138 bytes --]

asjo@koldfront.dk (Adam Sjøgren) 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 ø
in Jørgensen 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


[-- Attachment #1.2: mml2015.el (mml2015-epg-key-image): Use --display-charset utf-8 --]
[-- Type: text/x-patch, Size: 1634 bytes --]

From 8742f96f9595fd526b35400a221ca7a81cf1b292 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= <arne@arnested.dk>
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=UTF-8
Content-Transfer-Encoding: 8bit


Signed-off-by: Arne Jørgensen <arne@arnested.dk>
---
 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
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2012-12-27  Arne Jørgensen  <arne@arnested.dk>
+
+	* mml2015.el (mml2015-epg-key-image): Use --display-charset utf-8.
+
 2012-12-26  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* 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
--- 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
-                  (format "%s --list-options no-show-photos --attribute-fd 2 --list-keys %s > /dev/null"
+                  (format "%s --display-charset utf-8 --list-options no-show-photos --attribute-fd 2 --list-keys %s > /dev/null"
                           epg-gpg-program key-id))))
       (when (> (length data) 0)
         (insert (substring data 16))
-- 
Arne Jørgensen


[-- Attachment #2: Type: application/pgp-signature, Size: 543 bytes --]

  parent reply	other threads:[~2012-12-27  5:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15 14:12 Adam Sjøgren
2012-12-25 11:43 ` Lars Ingebrigtsen
2012-12-25 11:51   ` Adam Sjøgren
2012-12-25 12:00     ` Lars Ingebrigtsen
2012-12-25 12:05       ` Adam Sjøgren
2012-12-25 12:20         ` Lars Ingebrigtsen
2012-12-25 13:20           ` Adam Sjøgren
2012-12-25 13:47             ` Lars Ingebrigtsen
2012-12-25 22:33               ` Adam Sjøgren
2012-12-25 22:38                 ` Adam Sjøgren
2012-12-25 22:43                 ` Lars Ingebrigtsen
2012-12-25 22:57                 ` Andreas Schwab
2012-12-25 23:06                   ` Adam Sjøgren
2012-12-26  0:33                     ` Adam Sjøgren
2012-12-26  1:12                       ` Adam Sjøgren
2012-12-26  5:44                         ` Daiki Ueno
2012-12-26 13:24                           ` Adam Sjøgren
2012-12-27  5:16                         ` Arne Jørgensen [this message]
2012-12-28 21:00                           ` Adam Sjøgren
2012-12-28 21:03                             ` Adam Sjøgren
2012-12-28 21:09                               ` Adam Sjøgren
2012-12-28 22:04                                 ` Arne Jørgensen
2012-12-28 22:06                                   ` Adam Sjøgren
2012-12-27 10:06                         ` Julien Danjou
2012-12-27 10:38                           ` Andreas Schwab
2012-12-27 12:12                           ` Adam Sjøgren
2013-02-25  7:19                           ` Binjo
2013-02-25 19:13                             ` Adam Sjøgren
2013-02-26  2:22                               ` Binjo
2013-02-26 19:28                                 ` Adam Sjøgren
2013-02-27  2:27                                   ` Binjo
2012-12-26  9:14                       ` Andreas Schwab
2012-12-26 13:17                         ` Adam Sjøgren
2012-12-26 18:05                           ` Andreas Schwab
2012-12-26 22:06                             ` Adam Sjøgren
2012-12-26  4:22                 ` Daiki Ueno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2a9t0krbp.fsf@arnested.dk \
    --to=arne@arnested.dk \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).