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

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

[elpa] externals/ebdb 784f45c 060/350: New function ebdb-prompt-for-mail


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 784f45c 060/350: New function ebdb-prompt-for-mail
Date: Mon, 14 Aug 2017 11:46:03 -0400 (EDT)

branch: externals/ebdb
commit 784f45c64419ea376159c4e004c48dae5d34d068
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    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

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