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

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

[elpa] externals/ebdb 7f51a4e 5/9: Make explicit "full" formatter


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 7f51a4e 5/9: Make explicit "full" formatter
Date: Sun, 18 Feb 2018 22:56:25 -0500 (EST)

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

    Make explicit "full" formatter
    
    * ebdb-com.el (ebdb-full-formatter): New defconst holding the
      formatter used for displaying all a record's fields, even internal
      fields.
      (ebdb-display-records-completely): Use this new formatter. The old
      "clone" trick added a new spurious formatter to the formatter
      tracker every time it was called.
---
 ebdb-com.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/ebdb-com.el b/ebdb-com.el
index c7afbff..7688b01 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -428,6 +428,14 @@ position-marker mark)."
   :type 'ebdb-formatter-ebdb-oneline
   :group 'ebdb-record-display)
 
+(defconst ebdb-full-formatter
+  (make-instance 'ebdb-formatter-ebdb-multiline
+                :include nil :exclude nil
+                :combine nil :collapse nil
+                :object-name "full formatter")
+  "Formatter used for displaying all values of a record.
+This formatter should not be changed.")
+
 (defun ebdb-available-ebdb-formatters ()
   "A list of formatters available in the *EBDB* buffer.
 This list is also used for toggling layouts."
@@ -1852,14 +1860,9 @@ With any other non-nil ARG, RECORDS are displayed 
expanded."
 
 ;;;###autoload
 (defun ebdb-display-records-completely (records)
-  "Display RECORDS using layout `full-multi-line' (i.e., display all fields)."
+  "Display all fields of RECORDS."
   (interactive (list (ebdb-do-records)))
-  (let* ((record (ebdb-current-record t))
-         (current-fmt (nth 1 record))
-        ;; TODO: Something weird happens with duplication of
-        ;; formatter objects when we do this.
-         (fmt (clone current-fmt :include nil :exclude nil)))
-    (ebdb-redisplay-records records fmt)))
+  (ebdb-redisplay-records records ebdb-full-formatter))
 
 ;;;###autoload
 (defun ebdb-display-records-with-fmt (records fmt)



reply via email to

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