bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#53702: 27.1; diary does not display some entries in european style
Date: Thu, 08 Sep 2022 15:45:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Francesco Potortì <pot@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)


>From 5346b90b9884b9190cfe77310f2444ed35d182eb Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]