emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 4aa9845 07/10: Improve reading of states in German


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 4aa9845 07/10: Improve reading of states in German addresses
Date: Fri, 8 Oct 2021 13:59:58 -0400 (EDT)

branch: externals/ebdb
commit 4aa98450caabca8a0281e16e99dce056610949cf
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]