branch: externals/ebdb
commit 9a4288586d621d5aa1c44448a532634187c5c776
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
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.