[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb dc5d03e 01/21: Change behavior of ebdb-fmt-compose
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb dc5d03e 01/21: Change behavior of ebdb-fmt-compose-field |
Date: |
Sun, 17 Sep 2017 15:32:45 -0400 (EDT) |
branch: externals/ebdb
commit dc5d03e079e4ffe3860b2f234df5b16ae557953e
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Change behavior of ebdb-fmt-compose-field
* ebdb-format.el (ebdb-fmt-compose-field): This function should not
mapconcat the field-instance strings, that should be up to the
formatter.
* ebdb-com.el (ebdb-fmt-record-header, ebdb-fmt-record-body): Handle
the new return value.
---
ebdb-com.el | 26 +++++++++++++++-----------
ebdb-format.el | 12 ++++++------
2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index a6f0407..43723ea 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -515,21 +515,22 @@ This happens in addition to any pre-defined indentation
of STRING."
;; they're not displayed yet! How do we resolve this...?
(fill-column (window-text-width))
(fill-prefix (make-string (+ 5 indent) ?\s))
- (paragraph-start "[^:]+:[^\n]+$"))
+ (paragraph-start "[^:]+:[^\n]+$")
+ field-string)
(dolist (c field-list)
(insert (format label-fmt (car c)))
(put-text-property (line-beginning-position) (point) 'face 'ebdb-label)
- (insert
- (concat
- ": "
- ;; If I understood the mechanics of filling better, I
- ;; could probably do away with `ebdb-indent-string'
- ;; altogether.
- (ebdb-indent-string (cdr c) (+ indent 5))))
+ (insert (setq field-string
+ (concat
+ ": "
+ ;; If I understood the mechanics of filling better, I
+ ;; could probably do away with `ebdb-indent-string'
+ ;; altogether.
+ (ebdb-indent-string (mapconcat #'identity (cdr c) ", ") (+
indent 5)))))
;; If there are newlines in the value string, assume the field
;; knows what's it's doing re filling and formatting.
- (unless (or (string-match-p "\n" (cdr c))
+ (unless (or (string-match-p "\n" field-string)
(null ebdb-fill-field-values))
(fill-paragraph))
(insert "\n"))))
@@ -538,7 +539,10 @@ This happens in addition to any pre-defined indentation of
STRING."
(_record ebdb-record)
(field-list list))
(insert " ")
- (insert (mapconcat #'cdr field-list ", ")))
+ (insert (mapconcat (lambda (elt)
+ (mapconcat #'identity
+ (cdr elt) " "))
+ field-list ", ")))
(cl-defmethod ebdb-fmt-record-header ((_fmt ebdb-formatter-ebdb)
(record ebdb-record)
@@ -571,7 +575,7 @@ This happens in addition to any pre-defined indentation of
STRING."
;; differently. Conveniently, this also allows us to always
;; keep the image at the end of the header.
(unless (eql (plist-get f :class) 'ebdb-field-image)
- (cdr f)))
+ (mapconcat #'identity (cdr f) " ")))
field-list
", "))
;; TODO: Check if image is in field-list, not if it exists!
diff --git a/ebdb-format.el b/ebdb-format.el
index 46726e1..47b4f48 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -162,22 +162,22 @@ The FIELD-PLIST structure is that returned by
`ebdb-fmt-collect-fields'. It is a plist with three
keys: :class, :style, and :inst.
-This function passes the class and field instances to FMT,
-which formats them appropriately."
+This function passes the class and field instances to FMT, which
+formats them appropriately, and returns a list of (LABEL
+FIELD-STRING1 FIELD-STRING2 ..)."
(let* ((style (plist-get field-plist :style))
(inst (plist-get field-plist :inst))
(label (ebdb-fmt-field-label fmt
(if (= 1 (length inst))
(car inst)
- (plist-get field-plist :class))
+ (plist-get field-plist :class))
style
record)))
(cons label
- (mapconcat
+ (mapcar
(lambda (f)
(ebdb-fmt-field fmt f style record))
- inst
- ", "))))
+ inst))))
(cl-defmethod ebdb-fmt-field-label ((_fmt ebdb-formatter)
(cls (subclass ebdb-field))
- [elpa] externals/ebdb 6b605a9 06/21: Hash records against their tag field tags, (continued)
- [elpa] externals/ebdb 6b605a9 06/21: Hash records against their tag field tags, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 4206ccd 02/21: Don't unilaterally add to kill-emacs-hook, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 3311fc7 10/21: Add a dir file for the Info manual, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 62fcfcf 15/21: Add ebdb-save to write-contents-functions in EBDB buffers, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb a22c983 16/21: Try different faces in EBDB buffers, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 13f680a 13/21: Part two of threaded version of ebdb-initialize, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 3a918eb 09/21: Provide better instructions for BBDB migration, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb cbb4cc1 20/21: More complete error handling for field insertion, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb c298037 21/21: Bump version for 0.3.2, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 18be9ad 04/21: Add ebdb-field-bank-account class, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb dc5d03e 01/21: Change behavior of ebdb-fmt-compose-field,
Eric Abrahamsen <=
- [elpa] externals/ebdb 9c0947c 05/21: Comment out some custom definitions for address field, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 4a332dc 03/21: Add defgeneric for ebdb-read, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 767a9fa 07/21: Allow two kinds of searches on tags, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 8fc7b6d 08/21: Allow "fast lookups", Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb e3229ad 11/21: Give some indication that the migration process is ongoing, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb efd9e15 12/21: Provide an alternate threaded version of ebdb-initialize, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 2fa4379 14/21: New option ebdb-try-speedups, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 09a04b2 19/21: Fix up ebdb-string method for bank accounts, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb 2b52686 18/21: Check type spec of slots that may or may not accept an object, Eric Abrahamsen, 2017/09/17
- [elpa] externals/ebdb b3266e5 17/21: Apparently when-let will be obsoleted by when-let*, Eric Abrahamsen, 2017/09/17