[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 4fd89fe 01/10: Make all address slots skippable
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 4fd89fe 01/10: Make all address slots skippable |
Date: |
Fri, 8 Oct 2021 13:59:54 -0400 (EDT) |
branch: externals/ebdb
commit 4fd89fe651b01727cf603ba185b01109b8443f7f
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Make all address slots skippable
* ebdb.el (ebdb-read): You never know what kind of data people will
have to enter. Use `ebdb-with-exit' for everything, and use empty
strings for null values.
---
ebdb.el | 41 +++++++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index c7ff946..25ddb64 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -1861,31 +1861,44 @@ Primary sorts before normal sorts before defunct."
(locality
(if (plist-member slots :locality)
(plist-get slots :locality)
- (ebdb-read-string "Town/City"
- (when obj (ebdb-address-locality obj))
ebdb-locality-list)))
+ (or
+ (ebdb-with-exit
+ (ebdb-read-string "Town/City"
+ (when obj (ebdb-address-locality obj))
ebdb-locality-list))
+ "")))
(neighborhood
(if (plist-member slots :neighborhood)
(plist-get slots :neighborhood)
- (ebdb-read-string "Neighborhood/Suburb/Zone"
- (when obj (ebdb-address-neighborhood obj)))))
+ (or
+ (ebdb-with-exit
+ (ebdb-read-string "Neighborhood/Suburb/Zone"
+ (when obj (ebdb-address-neighborhood obj))))
+ "")))
(region
(if (plist-member slots :region)
(plist-get slots :region)
- (ebdb-read-string "State/Province"
- (when obj (ebdb-address-region obj))
ebdb-region-list)))
+ (or (ebdb-with-exit
+ (ebdb-read-string "State/Province"
+ (when obj (ebdb-address-region obj))
ebdb-region-list))
+ "")))
(postcode
(if (plist-member slots :postcode)
(plist-get slots :postcode)
- (ebdb-read-string "Postcode"
- (when obj (ebdb-address-postcode obj))
- ebdb-postcode-list)))
+ (or (ebdb-with-exit
+ (ebdb-read-string "Postcode"
+ (when obj (ebdb-address-postcode obj))
+ ebdb-postcode-list))
+ "")))
(country
(if (plist-member slots :country)
(plist-get slots :country)
- (ebdb-read-string "Country"
- (if obj (slot-value obj 'country)
- ebdb-default-country)
- ebdb-country-list))))
+ (or
+ (ebdb-with-exit
+ (ebdb-read-string "Country"
+ (if obj (slot-value obj 'country)
+ ebdb-default-country)
+ ebdb-country-list))
+ ""))))
(cl-call-next-method
class
@@ -1905,7 +1918,7 @@ Primary sorts before normal sorts before defunct."
(while t
(setq street
(ebdb-read-string
- (format "Street, line %d: " (1+ n))
+ (format "Street, line %d" (1+ n))
(nth n streets) ebdb-street-list))
(push street list)
(setq n (1+ n)))
- [elpa] externals/ebdb updated (b08a526 -> 13a9a9d), Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 4fd89fe 01/10: Make all address slots skippable,
Eric Abrahamsen <=
- [elpa] externals/ebdb a5571cf 03/10: Add address i18n for Singapore, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 8573c7f 02/10: Fix argument order in ebdb-read-i18n, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 082acb1 05/10: Fix retrieval of default when editing object labels, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 044b022 04/10: Remove the Universal Time flag for timestamp output, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 4aa9845 07/10: Improve reading of states in German addresses, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 8700b4a 06/10: Don't show redundant labels for fields that don't have their own, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 13a9a9d 10/10: Simplify German address formatting, bump version to 0.8.6, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 3e6bed6 09/10: Borrow changes from notification branch, Eric Abrahamsen, 2021/10/08
- [elpa] externals/ebdb 53773d1 08/10: Remove UK address read method from i18n-basic, Eric Abrahamsen, 2021/10/08