branch: externals/ebdb
commit 09a04b2d3c6bba250df508b54fa4eba0fd77cc0a
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Fix up ebdb-string method for bank accounts
* ebdb.el (ebdb-string): Protect against non-existent bank address,
swap newlines around, and use ebdb-string on the notes field --
previously this was outputting the string representation of the
object itself.
---
ebdb.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index 18896ad..2f091f5 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2285,8 +2285,9 @@ See `ebdb-url-valid-schemes' for a list of acceptable
schemes."
(with-slots (bank-name bank-address routing-aba swift-bic
account-name account-numbers notes)
acct
- (concat bank-name "\n\n"
- (ebdb-string bank-address) "\n"
+ (concat bank-name "\n"
+ (when bank-address (format "%s\n" (ebdb-string bank-address)))
+ "\n"
(when routing-aba
(format "Routing/ABA: %s\n" routing-aba))
(when swift-bic
@@ -2297,7 +2298,7 @@ See `ebdb-url-valid-schemes' for a list of acceptable
schemes."
(format "%s: %s" (car a) (cdr a)))
account-numbers "\n")
(when notes
- (format "\n%s\n" notes)))))
+ (format "\n%s\n" (ebdb-string notes))))))
;; Tags field.