Subject: Re: bug#15987: 24.3; diary-add-to-list ignored by diary-mark-entries

From: "Roland Winkler" <[email-masked]>
Date: Tue, 20 Aug 2019 21:48:00 -0500

On Sun Aug 18 2019 Stefan Kangas wrote:
> "Roland Winkler" <[email-masked]> writes:
> > On Sun Dec 1 2013 Stephen Berman wrote:
> >> It should be possible to do this by implementing a BBDB function for
> >> diary-goto-entry-function; see todo-diary-goto-entry for an example.
> >> (In fact, diary-goto-entry-function was added when the new version of
> >> todo-mode.el was added to Emacs, precisely for this purpose; note,
> >> however, that Todo files that are meant to contain diary entries must be
> >> included in the diary by the usual #include mechanism.)
> >
> > Thanks, I'll look into this.  Hopefully, such an approach will not
> > require too dirty tricks.
> 
> Did you ever get a chance to look into this?  I'm asking since it's
> been a while (six years more or less), and it would be good if we
> could clarify if this is indeed doable and/or desirable.

Thanks for the reminder.  Some time ago, I implemented a solution to
this, see the function bbdb-anniv-goto-entry in bbdb-anniv.el that
serves as a value for diary-goto-entry-function (see BBDB in GNU
Elpa or the BBDB repository on savannah).  Despite its (current)
prefix `bbdb' the function bbdb-anniv-goto-entry is really
independent of BBDB and it should work for other packages, too.  The
idea is to give strings passed to `diary-add-to-list' a text
property `diary-goto-entry' which should be a list (FUNCTION ARG1
ARG2 ...), see the docstring of bbdb-anniv-goto-entry.  Then,
bbdb-anniv-goto-entry checks for the presence of this text property
and calls FUNCTION to locate the entry.

I believe, the cleanest, backward-compatible solution would be to
use bbdb-anniv-goto-entry as a replacement for diary-goto-entry
and declare diary-goto-entry-function obsolete.  (The obsolete
variable diary-goto-entry-function could be kept for some time
without harm.)