GNU bug report logs - #53702
27.1; diary does not display some entries in european style

Previous Next

Package: emacs;

Reported by: Francesco Potortì <pot <at> gnu.org>

Date: Tue, 1 Feb 2022 16:23:01 UTC

Severity: normal

Tags: patch

Found in version 27.1

Fixed in version 31.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Francesco Potortì <pot <at> gnu.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 53702 <at> debbugs.gnu.org
Subject: Re: bug#53702: 27.1; diary does not display some entries in
 european style
Date: Thu, 08 Sep 2022 15:45:19 +0200
[Message part 1 (text/plain, inline)]
Francesco Potortì <pot <at> gnu.org> writes:

> Yes.  Can you please send it to me together with my report? (I don't
> remember the problem any more...)

Patch included below, and here's the original report:

Diary entries are not parsed by M-x diary if:
- calendar-date-style is set to european (rather than american)
AND
- the date is written as "3 Feb" (rather than 3/2)
AND
- the time is written as "18.00" (rather than 18:00)

At least, this is what I have found by trial and error.  I looked at the code in appt.el and diary-lib.el but was not able to find the culprit...

To reproduce:

$ emacs -Q -nw --load=appt-bug.el

You will see that only two european entries are shown (t1 and t2).

Then exit Emacs, comment out the second line in appt-bug-el and rerun Emacs as above: you will see four american entries (t1, t2, t3, t4).

================ appt-bug.el
(setq diary-file "~/appt-bug-diary"
      calendar-date-style 'european
      )
(load-library "diary-lib")
(diary-list-entries (list 2 3 (decoded-time-year (decode-time))) 1)

================ appt-bug-diary
	-*-diary-*-

3 Feb	18:00 t1 works (european)

3/2	18.00 t2 works (european)

3 Feb	18.00 t3 does not work (european)

3 Feb
	18.00 t4 does not work (european)

Feb 3	18:00 t1 works (american)

2/3	18.00 t2 works (american)

Feb 3	18.00 t3 works (american)

Feb 3
	18.00 t4 works (american)


[0001-WIP-Try-to-fix-53702.patch (text/x-diff, inline)]
From 5346b90b9884b9190cfe77310f2444ed35d182eb Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Wed, 2 Feb 2022 01:08:43 +0100
Subject: [PATCH] WIP: Try to fix #53702

---
 lisp/calendar/calendar.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 48d308afad..0605e4bf51 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -800,8 +800,8 @@ 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]\\)\\)")
-    (day " *" monthname " *" year "[^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.
 The defaults are: DAY/MONTH; DAY/MONTH/YEAR; DAY MONTHNAME;
--
2.30.2


This bug report was last modified 89 days ago.

Previous Next


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