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

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

[elpa] externals/gnorb 5adcc84 008/449: gnorb-utils: (gnorb-prompt-for-b


From: Stefan Monnier
Subject: [elpa] externals/gnorb 5adcc84 008/449: gnorb-utils: (gnorb-prompt-for-bbdb-record)
Date: Fri, 27 Nov 2020 23:14:57 -0500 (EST)

branch: externals/gnorb
commit 5adcc846a698efe1eb400068a8bab8169a78db8f
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    gnorb-utils: (gnorb-prompt-for-bbdb-record)
    
    New function
---
 lisp/gnorb-utils.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index a968e63..6716867 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -33,5 +33,17 @@
   "Glue code between Gnus, Org, and BBDB."
   :tag "Gnorb")
 
+(defun gnorb-prompt-for-bbdb-record ()
+  "Prompt the user for a BBDB record."
+  (let ((recs (bbdb-records))
+       name)
+    (while (> (length recs) 1)
+      (setq name
+           (completing-read
+            (format "Filter by regexp (%d remaining): " (length recs))
+            (mapcar 'bbdb-record-name recs)))
+      (setq recs (bbdb-search recs name name name nil nil)))
+    (car recs)))
+
 (provide 'gnorb-utils)
 ;;; gnorb-utils.el ends here



reply via email to

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