Subject: bug#53702: 27.1; diary does not display some entries in european style

From: Michael Heerdegen <[email-masked]>
Date: Wed, 02 Feb 2022 01:39:22 +0100

Francesco Potortì <[email-masked]> writes:

> (setq diary-file "~/appt-bug-diary"
>       calendar-date-style 'european
>       )

The recipe should better call the function `calendar-set-date-style'
because "setting this variable [calendar-date-style] directly does not
take effect (if the calendar package is already loaded).

But that doesn't prevent the issue - the report is valid nonetheless.
One already sees in the diary file that the problematic lines are not
fontified.

The manual describes that different time formats can be mixed, and

  3 Feb	18.00 t3 does not work (european)

is not invalid AFAIU (`diary-entry-time': "A period (.) can be used
instead of a colon (:) to separate the hour and minute parts.").

The problem is actually that the date part is rejected because the time
format is not recognized by `diary-european-date-forms'.  This seems to
fix it:

>From 07a072db84ec722e4e77d02c4d6aa77cafc19354 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <[email-masked]>
Date: Wed, 2 Feb 2022 01:08:43 +0100
Subject: [PATCH] WIP: Try to fix #53702

---
 lisp/calendar/calendar.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 48d308afad..d578d1a251 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -800,7 +800,7 @@ diary-american-date-forms
 (defcustom diary-european-date-forms
   '((day "/" month "[^/0-9]")
     (day "/" month "/" year "[^0-9]")
-    (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|\\([0-9]+[:aApP]\\)\\)")
+    (backup day " *" monthname "\\W+\\<\\([^*0-9]\\|\\([0-9]+[:.aApP]\\)\\)")
     (day " *" monthname " *" year "[^0-9:aApP]")
     (dayname "\\W"))
   "List of pseudo-patterns describing the European style of dates.
--
2.30.2

See also Bug#13536 which touched that definition.

We must be sure that the entries of `diary-european-date-forms' are
still mutually exclusive.  `year' never contains a dot "." (that regexp
is built in `diary-list-entries-2'), so I guess we are save... right?

Michael.