Subject: Re: bug#78120: 31.0.50; Calendar is not reliable with its marking

From: Michael Heerdegen <[email-masked]>
Date: Wed, 07 May 2025 00:44:33 +0200

Eli Zaretskii <[email-masked]> writes:

> Each face has a meaning, I presume?  If one face marks a date because
> John Doe was born at that day, and another face marks the same date
> because I have an important meeting, then the latter should "win",
> right?

It depends?  If John doe is your husband, maybe he is much more
important and should "win".  Maybe you will have a free day at his
birthday anyway.

Or: if it's three weeks before that day, John's birthday is more
relevant, because I might need to buy presents.  But one day before that
date I have the presents and have been informed about the birthday, but
I want to be reminded about the meeting now.

So this is a good example of how difficult this is.  It totally depends
on your life and your circumstances.  Also, Emacs doesn't know what an
"important meeting" is, and who John Doe is.

And the same is true for other sources of highlighting.  Are holidays
important?  Depends on how religious you are etc.

> Not names, meanings.  The names here don't explain themselves: 'diary'
> and 'success'.  If you know what those faces mean, please tell, and I
> will try to suggest which one should win in this case.

Note: the success face had been specified in the diary file (see the
recipe).  The user can specify any face name in the file.  Emacs doesn't
know what these "mean".  The only thing Emacs can know is: was the entry
that caused the mark a normal diary entry, a sexp entry, or does the
mark come from some function or via a hook - with other words, a rough
category that doesn't tell much on it's own.

> (Up front, I'd say that 'diary' should override the others, but I'm
> open to counter-arguments.)

May suggestion: first, when Emacs tries to mark a date, and there is
already a mark, we use the existing overlay instead of placing multiple.

Then, a function, value of a new defcustom, is used to decide what face
to place in a conflict.  And I would introduce a new face that means
"multiple marks on this date" that it can use.

But more importantly, it would be good if the mouse over text would list
the entries for that day.  Much more useful than programming face
fights.  Just give me a hint that there are multiple things "on" that
date.  This feature (listing diary entries for the clicked date) is
already available by explicit request via the mouse-3 menu btw.

Michael.