emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-bbdb link completion fix
@ 2014-04-28  9:31 Eric Abrahamsen
  2014-04-28 14:55 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2014-04-28  9:31 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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.

Thanks,
Eric


[-- 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."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-bbdb link completion fix
  2014-04-28  9:31 org-bbdb link completion fix Eric Abrahamsen
@ 2014-04-28 14:55 ` Nicolas Goaziou
  2014-04-29  1:03   ` Eric Abrahamsen
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2014-04-28 14:55 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

Hello,

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> 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.

Thank you for the patch.  Would you mind providing a proper commit
message and send it again?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-bbdb link completion fix
  2014-04-28 14:55 ` Nicolas Goaziou
@ 2014-04-29  1:03   ` Eric Abrahamsen
  2014-04-29  9:38     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2014-04-29  1:03 UTC (permalink / raw)
  To: emacs-orgmode

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

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> 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.
>
> Thank you for the patch.  Would you mind providing a proper commit
> message and send it again?

Yup, sorry about that.

Hey, on this subject... How do you all handle these situations with
one-time commits being sent to the list? It's kind of a pain making the
commit, then waiting for the same or equivalent commit to come back via
upstream, then reverting the local commit. Does everyone use throwaway
branches for this?

E


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-BBDB-link-completion.patch --]
[-- Type: text/x-diff, Size: 1139 bytes --]

From 55f41f66cd51ed27c396c3e7c805d83d894eb987 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Tue, 29 Apr 2014 08:59:13 +0800
Subject: [PATCH] Fix BBDB link completion

lisp/org-bbdb.el: org-bbdb-complete-link

Newer versions of BBDB seem to be returning atomic values from
`bbdb-completing-read-record', we should be prepared for both atoms
and lists.
---
 lisp/org-bbdb.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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."
-- 
1.9.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: org-bbdb link completion fix
  2014-04-29  1:03   ` Eric Abrahamsen
@ 2014-04-29  9:38     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2014-04-29  9:38 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

Hello,

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Thank you for the patch.  Would you mind providing a proper commit
>> message and send it again?
>
> Yup, sorry about that.

Patch applied. Thank you.



Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-29  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-28  9:31 org-bbdb link completion fix Eric Abrahamsen
2014-04-28 14:55 ` Nicolas Goaziou
2014-04-29  1:03   ` Eric Abrahamsen
2014-04-29  9:38     ` Nicolas Goaziou

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).