emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-agenda-open-link does not open bbdb links
@ 2013-05-24 15:46 Matt Lundin
  2013-06-27 13:53 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Lundin @ 2013-05-24 15:46 UTC (permalink / raw)
  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---

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

end of thread, other threads:[~2013-08-09  2:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-24 15:46 [BUG] org-agenda-open-link does not open bbdb links Matt Lundin
2013-06-27 13:53 ` Bastien
2013-08-09  2:22   ` Matt Lundin

Code repositories for project(s) associated with this public 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).