emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 5726c97 2/7: Add a ebdb-fmt-field implementation f


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 5726c97 2/7: Add a ebdb-fmt-field implementation for images
Date: Fri, 14 Dec 2018 15:44:20 -0500 (EST)

branch: externals/ebdb
commit 5726c97426ddef356f099e70ccdb0a2df8f9d3ab
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Add a ebdb-fmt-field implementation for images
    
    * ebdb-com.el (ebdb-fmt-field): This used to be hard-coded.
---
 ebdb-com.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ebdb-com.el b/ebdb-com.el
index bf98178..2a9c95a 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -642,6 +642,21 @@ Print the first line, add an ellipsis, and add a tooltip."
          (propertize value 'face 'ebdb-role-defunct)
        value))))
 
+(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter-ebdb)
+                             (field ebdb-field-image)
+                             _style
+                             (record ebdb-record))
+  (if (display-images-p)
+      (progn
+       (require 'image)
+       (propertize
+        " "
+        ;; Cribbed from `insert-image'.
+        (list 'display (ebdb-field-image-get field record)
+               'rear-nonsticky '(display)
+               'keymap image-map)))
+    "<img>"))
+
 (defsubst ebdb-indent-string (string column)
   "Indent nonempty lines in STRING to COLUMN (except first line).
 This happens in addition to any pre-defined indentation of STRING."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]