branch: externals/ebdb
commit 784f45c64419ea376159c4e004c48dae5d34d068
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>

    New function ebdb-prompt-for-mail
    
    * ebdb.el (ebdb-prompt-for-mail): Ask the user to choose one of a
      record's mail addresses. Returns the actual mail class.
---
 ebdb.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ebdb.el b/ebdb.el
index 4601992..dc58133 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3262,6 +3262,13 @@ Returns a list of (\"label\" slot . field-class)."
                            t)))
     (object-assoc db-string 'object-name collection)))
 
+(defun ebdb-prompt-for-mail (record)
+  (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))))
+
 (defun ebdb-dirty-records (&optional records)
   "Return all records with unsaved changes.
 

Reply via email to