branch: externals/ebdb
commit 4aa98450caabca8a0281e16e99dce056610949cf
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Improve reading of states in German addresses
Fix to b08a5264ef
* ebdb-i18n-basic.el (ebdb-read-i18n): Previous version _forced_ entry
of a state; make it optional.
---
ebdb-i18n-basic.el | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/ebdb-i18n-basic.el b/ebdb-i18n-basic.el
index 7f74402..c19ea1e 100644
--- a/ebdb-i18n-basic.el
+++ b/ebdb-i18n-basic.el
@@ -262,15 +262,17 @@ itself."
(_cc (eql deu))
&optional slots obj)
(unless (plist-member slots :region)
- (setq slots
- (plist-put
- slots :region
- (cdr (assoc-string
- (ebdb-read-string
- "State"
- (when obj (ebdb-address-region obj))
- ebdb-i18n-german-states t)
- ebdb-i18n-german-states)))))
+ (let ((state (ebdb-with-exit
+ (ebdb-read-string
+ "State"
+ (when obj (ebdb-address-region obj))
+ ebdb-i18n-german-states t))))
+ (setq slots
+ (plist-put
+ slots :region
+ (if state
+ (cdr (assoc-string state ebdb-i18n-german-states))
+ "")))))
slots)
(cl-defmethod ebdb-string-i18n ((address ebdb-field-address)