From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [BUG] org-agenda-open-link does not open bbdb links Date: Fri, 24 May 2013 10:46:49 -0500 Message-ID: <87d2sg753q.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfuCp-00084V-26 for emacs-orgmode@gnu.org; Fri, 24 May 2013 11:47:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfuCl-0006Ov-JH for emacs-orgmode@gnu.org; Fri, 24 May 2013 11:46:59 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:52252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfuCl-0006O6-BX for emacs-orgmode@gnu.org; Fri, 24 May 2013 11:46:55 -0400 Received: from archeee (unknown [67.175.202.232]) by mail.messagingengine.com (Postfix) with ESMTPA id 028E3C80004 for ; Fri, 24 May 2013 11:46:50 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode The function org-agenda-open-link does not open bbdb links. The reason is that bbdb agenda lines contain links that are not found in the entry. Because the agenda line is added to the strings scanned by org-offer-links-in-entry, it is added to the list of links (lk). I.e., both buffer and lk are defined, which triggers the first cond statement. The function then proceeds to search for this link in the buffer. It does not find it, since a bbdb-anniversary entry typically looks like this: * Anniversaries :PROPERTIES: :CATEGORY: anniv :END: %%(org-bbdb-anniversaries) But as a result, the function org-offer-links-in-entry never gets to the second cond statement, which would indeed open the link found in the agenda buffer. It seems to me that feeding the agenda line as a "prefix" to org-offer-links-in-entry is redundant, since the second cond statement explicitly looks for links in the agenda line. The following change fixes the problem, but before I submit it as a properly formatted patch, I want to make sure that it does not interfere with some other functionality. Best, Matt --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c615b58..1cc1c28 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8449,8 +8449,7 @@ It also looks at the text of the entry itself." (let* ((marker (or (org-get-at-bol 'org-hd-marker) (org-get-at-bol 'org-marker))) (buffer (and marker (marker-buffer marker))) - (prefix (buffer-substring (point-at-bol) (point-at-eol))) - (lkall (org-offer-links-in-entry buffer marker arg prefix)) + (lkall (org-offer-links-in-entry buffer marker arg)) (lk0 (car lkall)) (lk (if (stringp lk0) (list lk0) lk0)) (lkend (cdr lkall)) --8<---------------cut here---------------end--------------->8---