emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Subject: org-bbdb link completion fix
Date: Mon, 28 Apr 2014 17:31:18 +0800	[thread overview]
Message-ID: <87a9b5ssux.fsf@ericabrahamsen.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

The most recent versions of BBDB return single records from
`bbdb-completing-read-record'. That currently breaks completion on bbdb:
links -- possibly earlier versions of BBDB always returned list values.

We should probably check for this in `org-bbdb-complete-link', I propose
the attached patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-bbdb-fix.patch --]
[-- Type: text/x-diff, Size: 660 bytes --]

diff --git a/lisp/org-bbdb.el b/lisp/org-bbdb.el
index b9841a6..cfd5b3b 100644
--- a/lisp/org-bbdb.el
+++ b/lisp/org-bbdb.el
@@ -400,8 +400,11 @@ This is used by Org to re-create the anniversary hash table."
 (defun org-bbdb-complete-link ()
   "Read a bbdb link with name completion."
   (require 'bbdb-com)
-  (concat "bbdb:"
-	  (bbdb-record-name (car (bbdb-completing-read-record "Name: ")))))
+  (let ((rec (bbdb-completing-read-record "Name: ")))
+    (concat "bbdb:"
+	    (bbdb-record-name (if (listp rec)
+				  (car rec)
+				rec)))))
 (defun org-bbdb-anniv-export-ical ()
   "Extract anniversaries from BBDB and convert them to icalendar format."

             reply	other threads:[~2014-04-28  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  9:31 Eric Abrahamsen [this message]
2014-04-28 14:55 ` org-bbdb link completion fix Nicolas Goaziou
2014-04-29  1:03   ` Eric Abrahamsen
2014-04-29  9:38     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9b5ssux.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).