[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 7a19553 06/13: Shift base ebdb-fmt-record implemen
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 7a19553 06/13: Shift base ebdb-fmt-record implementation to ebdb-formatter-freeform |
Date: |
Tue, 15 Jan 2019 11:15:51 -0500 (EST) |
branch: externals/ebdb
commit 7a195530ade609e04122738dd68b4a3c0c148ff1
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Shift base ebdb-fmt-record implementation to ebdb-formatter-freeform
* ebdb-com.el (ebdb-fmt-record): This behavior is common to most
freeform formatters.
* ebdb-format.el (ebdb-fmt-record): So define it here.
---
ebdb-com.el | 23 +----------------------
ebdb-format.el | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 32e5bad..65b49ca 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -671,28 +671,7 @@ Print the first line, add an ellipsis, and add a tooltip."
(cl-defmethod ebdb-fmt-record ((fmt ebdb-formatter-ebdb)
(record ebdb-record))
- (pcase-let* ((header-classes (cdr (assoc (eieio-object-class-name record)
- (slot-value fmt 'header))))
- ((map header-fields body-fields)
- (seq-group-by
- (lambda (f)
- ;; FIXME: Consider doing the header/body split in
- ;; `ebdb-fmt-process-fields', we've already got the
- ;; formatter there.
- (if (ebdb-foo-in-list-p (alist-get 'class f)
- header-classes)
- 'header-fields
- 'body-fields))
- (ebdb-fmt-process-fields
- fmt record
- (ebdb-fmt-sort-fields
- fmt record
- (ebdb-fmt-collect-fields
- fmt record))))))
- (concat
- (ebdb-fmt-record-header fmt record header-fields)
- (ebdb-fmt-compose-fields fmt record body-fields 1)
- "\n")))
+ (concat (cl-call-next-method) "\n"))
(cl-defmethod ebdb-fmt-record-header ((fmt ebdb-formatter-ebdb)
(record ebdb-record)
diff --git a/ebdb-format.el b/ebdb-format.el
index 4435512..8de3f1a 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -398,6 +398,30 @@ multiple instances in a single alist."
outlist)))
(nreverse outlist))))
+(cl-defmethod ebdb-fmt-record ((fmt ebdb-formatter-freeform)
+ (record ebdb-record))
+ (pcase-let* ((header-classes (cdr (assoc (eieio-object-class-name record)
+ (slot-value fmt 'header))))
+ ((map header-fields body-fields)
+ (seq-group-by
+ (lambda (f)
+ ;; FIXME: Consider doing the header/body split in
+ ;; `ebdb-fmt-process-fields', we've already got the
+ ;; formatter there.
+ (if (ebdb-foo-in-list-p (alist-get 'class f)
+ header-classes)
+ 'header-fields
+ 'body-fields))
+ (ebdb-fmt-process-fields
+ fmt record
+ (ebdb-fmt-sort-fields
+ fmt record
+ (ebdb-fmt-collect-fields
+ fmt record))))))
+ (concat
+ (ebdb-fmt-record-header fmt record header-fields)
+ (ebdb-fmt-compose-fields fmt record body-fields 1))))
+
;; Tabular formatting
(cl-defmethod ebdb-fmt-record ((fmt ebdb-formatter-tabular)
- [elpa] externals/ebdb f133aef 03/13: Docstring fix for ebdb-mail, (continued)
- [elpa] externals/ebdb f133aef 03/13: Docstring fix for ebdb-mail, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 5ef1773 04/13: Allow overwriting of previous formatting buffers, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb eec63c8 07/13: Provide basic HTML5 freeform formatter, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 980927f 02/13: Switch from cond to pcase in ebdb-record-field, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 6dad4c1 09/13: Allow 'mail-primary as an argument to ebdb-record-field, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 4625970 11/13: Move map require from ebdb-com.el to ebdb.el, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 753c049 13/13: Bump to 0.6.3, flush recent changes, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 65247f6 08/13: Make csv-mode dependency optional, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb cbaa04b 10/13: Fix compose fields for the HTML5 freeform formatter, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb adb60dd 05/13: Refactor formatter classes, add tabular formatters, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 7a19553 06/13: Shift base ebdb-fmt-record implementation to ebdb-formatter-freeform,
Eric Abrahamsen <=
- [elpa] externals/ebdb 4f4596c 12/13: Re-absorb ebdb-counsel into main package, Eric Abrahamsen, 2019/01/15