emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-agenda thinks timestamps after 23:00 correspond to the next day [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)]
Date: Thu, 31 Mar 2022 23:57:55 +0700	[thread overview]
Message-ID: <20e6f6ec-de72-fcdf-87a6-717efec931d1@gmail.com> (raw)
In-Reply-To: <PAXPR06MB7760D440A9240E091CB7ED8BC6E19@PAXPR06MB7760.eurprd06.prod.outlook.com>

Confirmed

Emacs copy of Org changed the way of calling `encode-time' as a result 
interpretation of last nils returned by `org-parse-string' altered from 
ignored to "no DST".

Kyle, be aware of the conflict with `org-time-string-to-time' when you 
will port emacs commit dd0727e1ec1f535b9b06be88173b4d3ccd55abcb
Paul Eggert <eggert@cs.ucla.edu> Thu Dec 16 09:40:21 2021 -0800
encode-time simplifications

I hope, it is safe to pad `org-parse-time-string' return value with nil 
-1 nil instead of nil nil nil, but I have not tried to run tests (if 
they exist).

New calling convention for `encode-time' exists since emacs-27.1, so it 
is incompatible with yet supported emacs-26. It is unfortunate that 
sources in Org and in Emacs repository diverged, but I am unsure if it 
reasonable to introduce a new compatibility wrapper. Emacs developer may 
be unhappy if the change will be reverted to way deprecated way to call 
`encode-time'. For almost a year I am reading messages here that 
Emacs-28 is about to be released, so Emacs-26 is almost unsupported in Org.

On 31/03/2022 21:11, Ignacio Casso wrote:
>>
>> Could you, please, try
>>
>> (encode-time '(0 0 23 29 3 2022 nil -1 nil))
> 
> Thanks. Using -1 as DST argument indeed fixes it.
> 
> However, while testing that, I've realized that I made a mistake in the
> bug report. `encode-time' and `org-parse-time-string' return the same
> both in old and current Emacs and org-mode versions (by old Emacs I mean
> Emacs 27, not 26). The problem is that in ELPA's org-mode,
> `org-time-string-to-time' is defined as
> 
>    (apply #'encode-time (org-parse-time-string s)))
> 
> and in org-mode's built-in version of Emacs 29, it is defined as
> 
>    (encode-time (org-parse-time-string s)))

Thank you, Ignacio. I read the code of `encode-time' once more and see 
that the DST argument is taken into account only when date-time fields 
are passed as a list. It explains change of behavior despite of absence 
of apparent recent changes in the code of the function.

> and those two return different things. In the second case, the actual
> three last elements of the list returned by `org-parse-time-string' are
> used, and they are all nil. In the first case, according to the
> docstring of `encode-time', the last two elements of the list are
> ignored and -1 and nil are used as default.
> 
>> If my guess is right, `org-parse-time-string' should add -1 instead of
>> nil in that position.
> 
> So your guess is right, and doing this would restore the previous
> behavior. However, the curious things is that in the org-mode repository
> at git://git.savannah.gnu.org/emacs/org-mode.git,
> `org-time-string-to-time' still uses `apply', and always has. The
> change, and thus the bug, was only introduced directly in Emacs 29 a few
> months ago.
> 
> So I guess this is an Emacs 29 bug? I didn't know the two repositories
> could diverge like that. Should I report it to Emacs 29 maintainers?
> Or can org-mode maintainers fix it in the Emacs repository?

The problem is a consequence of grep-refactoring of Emacs code, but 
likely it should be fixed at the Org side.


  reply	other threads:[~2022-03-31 17:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 13:09 Ignacio Casso
2022-03-30  7:13 ` Ignacio Casso
2022-03-30  9:48   ` [BUG] org-agenda thinks timestamps after 23:00 correspond to the next day Max Nikulin
2022-03-30 10:17     ` Ignacio Casso
2022-03-31 12:38 ` [BUG] org-agenda thinks timestamps after 23:00 correspond to the next day [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)] Max Nikulin
2022-03-31 14:11   ` Ignacio Casso
2022-03-31 16:57     ` Max Nikulin [this message]
2022-03-31 21:37       ` Tim Cross
2022-04-05  4:20       ` Kyle Meyer
2022-04-22 15:47         ` Max Nikulin
2022-04-23  7:20           ` Ignacio Casso
2022-04-23  8:23             ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20e6f6ec-de72-fcdf-87a6-717efec931d1@gmail.com \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    --subject='Re: [BUG] org-agenda thinks timestamps after 23:00 correspond to the next day [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).