GNU bug report logs -
#53702
27.1; diary does not display some entries in european style
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53702 in the body.
You can then email your comments to 53702 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Tue, 01 Feb 2022 16:23:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Francesco Potortì <pot <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 01 Feb 2022 16:23:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Wed, 02 Feb 2022 00:40:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 53702 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Francesco Potortì <pot <at> gnu.org> 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:
[0001-WIP-Try-to-fix-53702.patch (text/x-diff, inline)]
From 07a072db84ec722e4e77d02c4d6aa77cafc19354 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 | 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
[Message part 3 (text/plain, inline)]
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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Wed, 02 Feb 2022 00:46:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 53702 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Francesco Potortì <pot <at> gnu.org> 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:
[0001-WIP-Try-to-fix-53702.patch (text/x-diff, inline)]
From 07a072db84ec722e4e77d02c4d6aa77cafc19354 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 | 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
[Message part 3 (text/plain, inline)]
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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Wed, 02 Feb 2022 03:42:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 53702 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello again,
sorry for the duplicated last message - my first message had bounced,
but apparently only from the poster's address.
Ok - small addition: the dot should be added in the subsequent line as
well:
[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
[Message part 3 (text/plain, inline)]
I'm now a bit worried about this paragraph in
(info "(emacs) Appointments"):
| You can write times in am/pm style (with ‘12:00am’ standing for
| midnight and ‘12:00pm’ standing for noon), or 24-hour European/military
| style. You need not be consistent; your diary file can have a mixture
| of the two styles. Times must be at the beginning of diary entries if
| they are to be recognized.
Military style is 1200 for 12:00am, right? This definitely can't be
used everywhere when using the European style because lines get
ambiguous: for digits could mean a year - or a military time in a line
not specifying a year. Should that paragraph be corrected?
Michael.
Added tag(s) patch.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Wed, 02 Feb 2022 18:14:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Fri, 04 Mar 2022 02:01:01 GMT)
Full text and
rfc822 format available.
Message #19 received at 53702 <at> debbugs.gnu.org (full text, mbox):
Hello Francesco,
did you have the chance to try if that patch (repeated below) fixes your
problem?
Regards,
Michael.
> 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
>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Thu, 08 Sep 2022 13:30:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 53702 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> did you have the chance to try if that patch (repeated below) fixes your
> problem?
This was half a year ago, but I see that Francesco wasn't in the CCs, so
perhaps he never got the message?
Francesco, can you try Michael's patch and see whether that fixes the
problem?
> I'm now a bit worried about this paragraph in
> (info "(emacs) Appointments"):
>
> | You can write times in am/pm style (with ‘12:00am’ standing for
> | midnight and ‘12:00pm’ standing for noon), or 24-hour European/military
> | style. You need not be consistent; your diary file can have a mixture
> | of the two styles. Times must be at the beginning of diary entries if
> | they are to be recognized.
>
> Military style is 1200 for 12:00am, right? This definitely can't be
> used everywhere when using the European style because lines get
> ambiguous: for digits could mean a year - or a military time in a line
> not specifying a year. Should that paragraph be corrected?
12:00am (midnight) is the same as 00:00/24:00 in military style.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Thu, 08 Sep 2022 13:43:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 53702 <at> debbugs.gnu.org (full text, mbox):
>Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>> did you have the chance to try if that patch (repeated below) fixes your
>> problem?
>
>This was half a year ago, but I see that Francesco wasn't in the CCs, so
>perhaps he never got the message?
I suspect so...
>Francesco, can you try Michael's patch and see whether that fixes the
>problem?
Yes. Can you please send it to me together with my report? (I don't remember the problem any more...)
>> I'm now a bit worried about this paragraph in
>> (info "(emacs) Appointments"):
>>
>> | You can write times in am/pm style (with ‘12:00am’ standing for
>> | midnight and ‘12:00pm’ standing for noon), or 24-hour European/military
>> | style. You need not be consistent; your diary file can have a mixture
>> | of the two styles. Times must be at the beginning of diary entries if
>> | they are to be recognized.
>>
>> Military style is 1200 for 12:00am, right?
Mh. Military style is 12:00 (or 12.00) for noon. That's for sure.
I suppose that in am/pm style we have:
00:00 am midnight this day
11:59 am one minute to noon today
00:00 pm noon
11:59 pm one minute to midnight today
This would imply what is written in the paragraph you cited above.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Thu, 08 Sep 2022 13:46:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 53702 <at> debbugs.gnu.org (full text, mbox):
[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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Fri, 09 Sep 2022 04:15:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 53702 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> This was half a year ago, but I see that Francesco wasn't in the CCs, so
> perhaps he never got the message?
I thought the reporter always gets all messages in his bug's thread
automatically?
> 12:00am (midnight) is the same as 00:00/24:00 in military style.
Then my concerns about that paragraph were ill-founded.
Ok, then let's see if Francesco is happy with the patch.
Michael.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#53702
; Package
emacs
.
(Fri, 09 Sep 2022 17:09:03 GMT)
Full text and
rfc822 format available.
Message #34 received at 53702 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>> This was half a year ago, but I see that Francesco wasn't in the CCs, so
>> perhaps he never got the message?
>
> I thought the reporter always gets all messages in his bug's thread
> automatically?
I've always assumed that they only get the messages explicitly directed
at them (as well as the response from the "-done" message). But I don't
really know. 🫠
Reply sent
to
Stefan Kangas <stefankangas <at> gmail.com>
:
You have taken responsibility.
(Sun, 23 Feb 2025 05:39:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Francesco Potortì <pot <at> gnu.org>
:
bug acknowledged by developer.
(Sun, 23 Feb 2025 05:39:02 GMT)
Full text and
rfc822 format available.
Message #39 received at 53702-done <at> debbugs.gnu.org (full text, mbox):
Version: 31.1
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>
>> did you have the chance to try if that patch (repeated below) fixes your
>> problem?
>
> This was half a year ago, but I see that Francesco wasn't in the CCs, so
> perhaps he never got the message?
>
> Francesco, can you try Michael's patch and see whether that fixes the
> problem?
>
>> I'm now a bit worried about this paragraph in
>> (info "(emacs) Appointments"):
>>
>> | You can write times in am/pm style (with ‘12:00am’ standing for
>> | midnight and ‘12:00pm’ standing for noon), or 24-hour European/military
>> | style. You need not be consistent; your diary file can have a mixture
>> | of the two styles. Times must be at the beginning of diary entries if
>> | they are to be recognized.
>>
>> Military style is 1200 for 12:00am, right? This definitely can't be
>> used everywhere when using the European style because lines get
>> ambiguous: for digits could mean a year - or a military time in a line
>> not specifying a year. Should that paragraph be corrected?
>
> 12:00am (midnight) is the same as 00:00/24:00 in military style.
This patch fixes the bug here, so I installed it with a fixed up commit
message (commit 8b0043ffd60). I'm therefore closing this bug report.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 23 Mar 2025 11:24:12 GMT)
Full text and
rfc822 format available.
This bug report was last modified 46 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.