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

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

[elpa] externals/ebdb 3f3e7bf 2/6: Add a "prompt" argument to ebdb-promp


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 3f3e7bf 2/6: Add a "prompt" argument to ebdb-prompt-for-record
Date: Thu, 26 Jul 2018 16:26:06 -0400 (EDT)

branch: externals/ebdb
commit 3f3e7bfe98ac75a85aa29fa37eed539cfd12825d
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Add a "prompt" argument to ebdb-prompt-for-record
    
    * ebdb.el (ebdb-prompt-for-record): We need to be able to customize
      the prompt.
---
 ebdb.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/ebdb.el b/ebdb.el
index 84ad862..07c7e3c 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -4118,11 +4118,12 @@ the class symbol of OBJ, or nil."
        (push d unsynced)))
     unsynced))
 
-(defun ebdb-prompt-for-record (&optional records class)
+(defun ebdb-prompt-for-record (&optional records class prompt)
   "Prompt for a single record, and return it.
-If RECORDS is a list of records, offer choices from that list.  If
-CLASS is given, only offer choices that are an instance of that
-class, or its subclasses."
+If RECORDS is a list of records, offer choices from that list.
+If CLASS is given, only offer choices that are an instance of
+that class, or its subclasses.  If PROMPT is given, use that as
+the prompt."
   (let* ((recs (or records (ebdb-records)))
         (pairs
          (mapcar
@@ -4140,7 +4141,7 @@ class, or its subclasses."
             recs)))
         (result
          (completing-read
-          "Choose record: "
+          (or prompt "Choose record: ")
           pairs)))
     (ebdb-gethash (cdr (assoc-string result pairs)) 'uuid)))
 



reply via email to

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