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

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

[elpa] externals/ebdb 9a42885 061/350: ebdb-prompt-for-mail should retur


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 9a42885 061/350: ebdb-prompt-for-mail should return single mails with no prompt
Date: Mon, 14 Aug 2017 11:46:03 -0400 (EDT)

branch: externals/ebdb
commit 9a4288586d621d5aa1c44448a532634187c5c776
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    ebdb-prompt-for-mail should return single mails with no prompt
    
    * ebdb.el (ebdb-prompt-for-mail): If there's only one mail, don't ask
      about it.
---
 ebdb.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index dc58133..759024a 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3266,8 +3266,10 @@ Returns a list of (\"label\" slot . field-class)."
   (let ((mail-alist (mapcar
                     (lambda (m) (cons (ebdb-string m) m))
                     (ebdb-record-mail record t))))
-    (cdr (assoc (ebdb-read-string "Mail address: " nil mail-alist t)
-               mail-alist))))
+    (cdr (if (= 1 (length mail-alist))
+            (car mail-alist)
+          (assoc (ebdb-read-string "Mail address: " nil mail-alist t)
+                 mail-alist)))))
 
 (defun ebdb-dirty-records (&optional records)
   "Return all records with unsaved changes.



reply via email to

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