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

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

[elpa] externals/ebdb 5735686: New ebdb-fmt-field for the oneline style


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 5735686: New ebdb-fmt-field for the oneline style in EBDB buffers
Date: Wed, 15 Nov 2017 21:22:32 -0500 (EST)

branch: externals/ebdb
commit 5735686879b9d017b8d94c8805c745ef97c5d638
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    New ebdb-fmt-field for the oneline style in EBDB buffers
    
    * ebdb-com.el (ebdb-fmt-field): Add an ellipsis, and a tooltip.
---
 ebdb-com.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ebdb-com.el b/ebdb-com.el
index e989b6e..d9b49ce 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -477,6 +477,18 @@ property is the field instance itself."
   (propertize (cl-call-next-method) 'ebdb-field field))
 
 (cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter-ebdb)
+                             (field ebdb-field)
+                             (_style (eql oneline))
+                             (_record ebdb-record))
+  "Handle the `oneline' style in EBDB buffers.
+Print the first line, add an ellipsis, and add a tooltip."
+  (pcase-let* ((full (ebdb-string field))
+              (`(,head . ,tail) (split-string full "\n")))
+    (concat (propertize head 'help-echo full)
+           (when tail
+            (propertize "…" 'cursor-intangible t)))))
+
+(cl-defmethod ebdb-fmt-field ((_fmt ebdb-formatter-ebdb)
                              (field ebdb-field-url)
                              _style
                              (_record ebdb-record))



reply via email to

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