[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111330: Display images from gpg sign
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111330: Display images from gpg signatures |
Date: |
Tue, 25 Dec 2012 23:49:35 +0100 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111330
author: Adam Sjogren <address@hidden>
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Tue 2012-12-25 23:49:35 +0100
message:
Display images from gpg signatures
* epg.el (epg-signature-to-string): Use new functions
epg-key-image, epg-key-image-to-string to find and display image
from key.
modified:
lisp/ChangeLog
lisp/epg.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-12-24 17:49:19 +0000
+++ b/lisp/ChangeLog 2012-12-25 22:49:35 +0000
@@ -1,3 +1,9 @@
+2012-12-25 Adam Sjøgren <address@hidden>
+
+ * epg.el (epg-signature-to-string): Use new functions
+ epg-key-image, epg-key-image-to-string to find and display image
+ from key.
+
2012-12-24 Constantin Kulikov <address@hidden> (tiny change)
* startup.el (initial-buffer-choice): Allow function as value
=== modified file 'lisp/epg.el'
--- a/lisp/epg.el 2012-12-21 07:35:02 +0000
+++ b/lisp/epg.el 2012-12-25 22:49:35 +0000
@@ -967,11 +967,34 @@
(setcdr entry value)
(epg-context-set-result context (cons (cons name value) result)))))
+(defun epg-key-image (key-id)
+ "Return the image of a key, if any"
+ (let ((filename
+ (replace-regexp-in-string
+ "\n" ""
+ (shell-command-to-string
+ (concat "/usr/bin/gpg --photo-viewer 'echo %I >&2' --list-keys "
+ key-id " > /dev/null")))))
+ (when (and (not (string-equal filename ""))
+ (file-exists-p filename))
+ (create-image filename))))
+
+(defun epg-key-image-to-string (key-id)
+ "Return a string with the image of a key, if any"
+ (let* ((result "")
+ (key-image (epg-key-image key-id)))
+ (when key-image
+ (setq result " ")
+ (put-text-property 1 2 'display key-image result))
+ result))
+
(defun epg-signature-to-string (signature)
"Convert SIGNATURE to a human readable string."
(let* ((user-id (cdr (assoc (epg-signature-key-id signature)
epg-user-id-alist)))
- (pubkey-algorithm (epg-signature-pubkey-algorithm signature)))
+ (pubkey-algorithm (epg-signature-pubkey-algorithm signature))
+ (key-id (epg-signature-key-id signature))
+ (key-image (epg-key-image-to-string key-id)))
(concat
(cond ((eq (epg-signature-status signature) 'good)
"Good signature from ")
@@ -985,7 +1008,8 @@
"Signature made by revoked key ")
((eq (epg-signature-status signature) 'no-pubkey)
"No public key for "))
- (epg-signature-key-id signature)
+ key-id
+ key-image
(if user-id
(concat " "
(if (stringp user-id)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111330: Display images from gpg signatures,
Lars Ingebrigtsen <=