[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [BUG] BBDB anniversary links don't open in agenda

From: Matt Lundin
Subject: [O] [BUG] BBDB anniversary links don't open in agenda
Date: Thu, 11 Sep 2014 10:08:51 -0500
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux)

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:


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

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]