Subject: Re: bug#55284: 28.1; TODO Mode - Unable to operate if `calendar-date-style' is set to 'iso

From: Stephen Berman <[email-masked]>
Date: Fri, 06 May 2022 10:59:14 +0200

On Fri, 06 May 2022 09:44:27 +0300 Eli Zaretskii <[email-masked]> wrote:

>> Date: Fri, 6 May 2022 00:01:37 +0100
>> From:  Christos Ballas via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>>
>> Starting from emacs -q
>> (setq calendar-date-style 'iso)
>> M-x todo-show -> Test -> Test

You left out the prompt for a Todo item; typing an item and RET at the
prompt will insert the item into the category with the date header in
ISO format.  However, the date is not correctly fontified, which is a
sign of trouble...

>> In the newly constructed buffer type "i i Test2<enter>"
>> Emacs will now hang until you type "C-g"
>
> It looks like todo-mode.el is basically incompatible with any
> calendar-date-style but 'american'.

It also works with the 'european' style, but indeed not with 'iso'.

> (Btw, you aren't supposed to set calendar-date-style directly.  But
> going through the Customize interface, as you are supposed to, doesn't
> help in this case, because the relevant todo-mode patterns are
> defconst's.)

Yes, this is something that's always bothered me (as Todo mode
maintainer) but IIRC my brief investigation of the issue way back when
convinced me that it was not easy (for me) to fix.  I don't use the ISO
date style in Todo mode myself and saw no complaints till now, so I
haven't tried again to fix it.  Unfortunately, I can't afford to do
time-consuming debugging and testing now, so if it is possible to fix
this bug, I would encourage someone better acquainted than me with the
Calendar/Diary handling of dates to do it.  Otherwise, I'll look into it
when I have the time.

One of the issues I remember being bothered by is if someone wants to
change back and forth between date styles.  It seems that this is not
(fully) supported by diary-lib.el (I'm filing a separate bug report
about that).  If that can be fixed, it might be applicable to Todo mode.

Steve Berman