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

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

[elpa] externals/gnorb 7ea06f9 339/449: Delete gnorb-prompt-for-bbdb-rec


From: Stefan Monnier
Subject: [elpa] externals/gnorb 7ea06f9 339/449: Delete gnorb-prompt-for-bbdb-record
Date: Fri, 27 Nov 2020 23:16:07 -0500 (EST)

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

    Delete gnorb-prompt-for-bbdb-record
    
    * gnorb-utils.el: This function is unnecessary, BBDB already provides
      `bbdb-completing-read-record'! Don't re-invent wheel.
    * gnorb-org.el (gnorb-org-contact-link): Use existing function.
    * gnorb-bbdb.el (gnorb-bbdb-cite-contact): Use existing function.
---
 gnorb-bbdb.el  |  2 +-
 gnorb-org.el   |  2 +-
 gnorb-utils.el | 15 ---------------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/gnorb-bbdb.el b/gnorb-bbdb.el
index 306ea01..c7e18d6 100644
--- a/gnorb-bbdb.el
+++ b/gnorb-bbdb.el
@@ -442,7 +442,7 @@ a prefix arg and \"*\", the prefix arg must come first."
 
 ;;;###autoload
 (defun gnorb-bbdb-cite-contact (rec)
-  (interactive (list (gnorb-prompt-for-bbdb-record)))
+  (interactive (list (bbdb-completing-read-record "Record: ")))
   (let ((mail-string (bbdb-dwim-mail rec)))
    (if (called-interactively-p 'any)
        (insert mail-string)
diff --git a/gnorb-org.el b/gnorb-org.el
index 615e48b..fe7bcae 100644
--- a/gnorb-org.el
+++ b/gnorb-org.el
@@ -123,7 +123,7 @@ There's really no reason to use this instead of regular old
 `org-insert-link' with BBDB completion. But there might be in the
 future!"
   ;; this needs to handle an active region.
-  (interactive (list (gnorb-prompt-for-bbdb-record)))
+  (interactive (list (bbdb-completing-read-record "Record: ")))
   (let* ((name (bbdb-record-name rec))
         (link (concat "bbdb:" (org-link-escape name))))
     (org-store-link-props :type "bbdb" :name name
diff --git a/gnorb-utils.el b/gnorb-utils.el
index 4d473f1..723f27b 100644
--- a/gnorb-utils.el
+++ b/gnorb-utils.el
@@ -39,21 +39,6 @@
 `gnorb-org-trigger-actions'"
  "September 8, 2014" 'set)
 
-(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 records by regexp (%d remaining): "
-                    (length recs))
-            (mapcar 'bbdb-record-name recs)))
-      (setq recs (bbdb-search recs name name name nil nil)))
-    (if recs
-       (car recs)
-      (error "No matching records"))))
-
 (defvar gnorb-tmp-dir (make-temp-file "emacs-gnorb" t)
   "Temporary directory where attachments etc are saved.")
 



reply via email to

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