branch: externals/ebdb
commit 727eddb2f8e4ff721a8805a6dcf161480ac1680d
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Change databases' buffer-char slot into actual character
* ebdb.el (ebdb-db): Should be stored as an actual character.
* ebdb-com.el (ebdb-record-db-char-string): Display as such.
---
ebdb-com.el | 12 +++++++-----
ebdb.el | 6 +++---
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index ad341e2..6123726 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -420,11 +420,13 @@ This list is also used for toggling layouts."
(cl-defmethod ebdb-record-db-char-string ((record ebdb-record))
(let* ((dbs (slot-value (ebdb-record-cache record) 'database))
(char-string
- (mapconcat
- (lambda (d)
- (when (slot-value d 'buffer-char)
- (slot-value d 'buffer-char)))
- dbs "")))
+ (concat
+ (delq nil
+ (mapcar
+ (lambda (d)
+ (when (slot-value d 'buffer-char)
+ (slot-value d 'buffer-char)))
+ dbs)))))
(propertize char-string 'face 'ebdb-db-char)))
(cl-defmethod ebdb-fmt-field-label ((_fmt ebdb-formatter-ebdb)
diff --git a/ebdb.el b/ebdb.el
index 080d47e..fa50561 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2803,9 +2803,9 @@ executable. When a symbol, assume an Elisp function."
records created in this database.")
(buffer-char
:initarg :buffer-char
- :type string
- :initform ""
- :custom string
+ :type (or null character)
+ :initform nil
+ :custom character
:documentation
"A single character used in the *EBDB* buffer to indicate the
database(s) to which a record belongs.")