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

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

[elpa] externals/ebdb a0eada8 128/350: Change some of the EBDB buffer fo


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb a0eada8 128/350: Change some of the EBDB buffer formatting defaults
Date: Mon, 14 Aug 2017 11:46:20 -0400 (EDT)

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

    Change some of the EBDB buffer formatting defaults
    
    * ebdb-format.el: By default, add ebdb-field-address to the :collapse
      slot of the formatters.  Also, by default format fields using the
      'normal style rather than the 'oneline style.
    
    What this means, practically, is that most fields are just output
    using `ebdb-string'.  Previously, everything was output as 'oneline,
    which meant a bunch of spurious `split-strings', now they just dump
    their whole strings.  Nothing actually specializes on 'normal, but it
    will hit the catch-all.
    
    Addresses are now 'collapse, which is re-routed to 'oneline by
    default, which means addresses are the only fields that get
    `split-string'ed, but it's also possible to catch 'collapse and do
    something different.
---
 ebdb-format.el | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/ebdb-format.el b/ebdb-format.el
index 1fcc5b9..b674a1a 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -47,9 +47,8 @@
     :type list
     :initarg :include
     :initform nil
-    :documentation "A list of field classes to include.  If both
-    \"include\" and \"exclude\" are given, the \"exclude\" slot
-    will be ignored.")
+    :documentation "A list of field classes to include.  If
+    \"include\" and \"exclude\" conflict, \"exclude\" loses.")
    (exclude
     :type list
     :initarg :exclude
@@ -58,7 +57,10 @@
    (sort
     :type list
     :initarg :sort
-    :initform '(ebdb-field-mail ebdb-field-phone ebdb-field-address "_" 
ebdb-field-notes))
+    :initform '(ebdb-field-mail ebdb-field-phone ebdb-field-address "_" 
ebdb-field-notes)
+    :documentation "How field instances should be sorted.  Field
+    classes should be listed in their proper sort order.  A \"_\"
+    placeholder indicates where all other fields should go." )
    (primary
     :type boolean
     :initarg :primary
@@ -79,7 +81,7 @@
    (collapse
     :type list
     :initarg :collapse
-    :initform nil
+    :initform '(ebdb-field-address)
     :documentation "A list of field classes which should be
     \"collapsed\". What this means is up to the formatter, but it
     generally indicates that most of the field contents will
@@ -216,6 +218,13 @@ which formats them appropriately."
 
 (cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter)
                              (field ebdb-field)
+                             (style (eql collapse))
+                             (record ebdb-record))
+  "For now, treat collapse the same as oneline."
+  (ebdb-fmt-field fmt field 'oneline record))
+
+(cl-defmethod ebdb-fmt-field ((fmt ebdb-formatter)
+                             (field ebdb-field)
                              _style
                              (record ebdb-record))
   "The base implementation for FIELD simply returns the value of
@@ -368,7 +377,7 @@ grouped by field class."
                      :style
                      (cond
                       ((ebdb-class-in-list-p cls collapse) 'collapse)
-                      (t 'oneline)))
+                      (t 'normal)))
                outlist)))
       outlist)))
 



reply via email to

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