GNU bug report logs - #49995
28.0.50; EBDB Anniversaries do not appear marked in calendar

Previous Next

Package: emacs;

Reported by: Pankaj Jangid <pankaj <at> codeisgreat.org>

Date: Wed, 11 Aug 2021 07:14:02 UTC

Severity: normal

Found in version 28.0.50

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 49995 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 49995 <at> debbugs.gnu.org, Pankaj Jangid <pankaj <at> codeisgreat.org>
Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in
 calendar
Date: Sat, 14 Aug 2021 11:08:13 -0700
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Oof, EBDB's diary integration was "write once and back away slowly"
>> code. I'm trying to understand diary-lib.el. So far as I can see, when
>> you add diary entries to `diary-entry-list' [...]
>
> Suggestion: provide a new diary-sexp function, similar to
> `diary-lunar-phases'.  Then marking would be handled by the diary.
>
> That function just has to return nil or a string (or a mark and a
> string) depending on the dynamical variable DATE.  That's already the
> whole diary related part.  People then have to add that function as sexp
> entry to their diary if they want.

Oh, huh: sort of inverting the prior approach. I find all this a little
confusing, I've never spent any time with the diary, and its integration
with Org always seemed very mysterious to me. But I do think the
calendar integration is very useful.

So the idea is that there would be a `ebdb-diary-anniversaries'
function, that looks sort of like:

(defun ebdb-diary-anniversaries (&optional mark)
  (with-suppressed-warnings ((lexical date))
    (defvar date))
  (when-let ((anniv-today (ebdb-get-anniversaries-for-date date)))
    (cons mark (mapconcat #'identity anniv-today "\n"))))

Something like that, anyway, and then users put

%%(ebdb-diary-anniversaries)

In their diary file? And that would get called once per visible date, so
potentially a whole lot, so `ebdb-get-anniversaries-for-date' should be
quick...

Anyway, thanks for this alternate suggestion! This wouldn't have
occurred to me.

Eric




This bug report was last modified 3 years and 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.