emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] BBDB anniversary links don't open in agenda
@ 2014-09-11 15:08 Matt Lundin
  0 siblings, 0 replies; only message in thread
From: Matt Lundin @ 2014-09-11 15:08 UTC (permalink / raw)
  To: Org Mode

BBDB anniversary links don't open in the agenda.

At the moment, the function org-agenda-open-link seems to be set up only
to open links if they are actually in the original buffer. But bbdb
anniversary links are generated from the following sexp:

%%(org-bbdb-anniversaries)

When org-agenda-open-link jumps to the buffer to look for a link like
[[bbdb:John Doe]], it will not find it. This seems symptomatic of a
bigger problem in org-agenda-open-link, which is that (AFAICT) it will
*never* get to the second item in the conditional.

Here are the details:

1. This bit of code searches both the original buffer and the agenda
line for links (notice the prefix):

,----[ org-agenda.el, lines 8516-8519
| 	 (buffer (and marker (marker-buffer marker)))
| 	 (prefix (buffer-substring (point-at-bol) (point-at-eol)))
|  	 (lkall (and buffer (org-offer-links-in-entry
| 			     buffer marker arg prefix)))
`----

2. This will trigger the first conditional, since there will always be
both a buffer and a link. But this means that the function never arrives
at the second conditional, which opens links found in the agenda buffer
itself.

3. Instead, a bbdb link will be lost in the first conditional, which
assumes that that the link can actually be found in the buffer.

,----[ 8530-8537
| 		  (if (or (not trg) (string-match org-any-link-re trg))
| 		      (save-excursion
| 			(save-restriction
| 			  (widen)
| 			  (goto-char marker)
| 			  (when (search-forward l nil lkend)
| 			    (goto-char (match-beginning 0))
| 			    (org-open-at-point))))
`----

The bug was introduced with commit
bd779fad624af01dbcb35b381dee10452dc945b1 on Jan 13, 2013:

It would be easy enough to insert a check for bbdb links in the first
conditional clause. However, it seems to me that the logic of
org-agenda-open-link has become rather convoluted.

Is there a scenario in which one would ever reach the second conditional
clause, which opens links found only in the agenda buffer?

Any advice on the best way to proceed would be greatly appreciated.

Best,
Matt

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-11 15:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 15:08 [BUG] BBDB anniversary links don't open in agenda 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).