Subject: bug#54731: Please, revert part of dd0727e1ec1 related to Org mode (`encode-time')

From: Max Nikulin <[email-masked]>
Date: Tue, 5 Apr 2022 23:43:35 +0700

Recently a bug with daylight saving time has been reported to the Org 
mode mail list:

https://list.orgmode.org/[email-masked]
Ignacio Casso. [BUG] org-agenda thinks timestamps after 23:00 correspond 
to the next day. Tue, 29 Mar 2022 15:09:10 +0200.

It can be reproduced only with the Org version bundled with Emacs-29. 
The code from the Org git repository works correctly. Due to Emacs 
commit dd0727e1ec1
    Paul Eggert Thu Dec 16 09:40:21 2021 -0800 encode-time simplifications
code of Org in the Emacs and the Org repositories diverged. Changes can 
not be just committed to Org since Org as a standalone package is 
compatible with Emacs-26 and even still with Emacs-25 where new style of 
`encode-time' arguments are not supported.

Moreover daylight saving time flag is ignored when timestamp components 
are passed as separate arguments and some Org code uses nil value (no 
DST) instead of -1 (ignore DST).

Even within Emacs both old and new calling styles of `encode-time' are 
used, so partial revert of the change does not reduce code consistency 
significantly enough.

On the Org side it is necessary to update at least the 
`org-parse-time-string' function and to introduce a compatibility 
wrapper that will use old calling convention when running under old 
Emacs versions. Such changes should finally land in the Emacs repository 
as well.

Please, revert changes from dd0727e1ec1 related to Org to fix the 
daylight saving time and to mitigate merge conflicts during porting of 
future fixes in Org.

Notice, this bug is namely for Emacs, not for Org mode as debbugs packages.