emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ignacio Casso <ignaciocasso@hotmail.com>
To: Max Nikulin <manikulin@gmail.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 16:11:29 +0200	[thread overview]
Message-ID: <PAXPR06MB7760D440A9240E091CB7ED8BC6E19@PAXPR06MB7760.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <t247ct$ik5$1@ciao.gmane.io>


>
> Ubuntu-20.04 LTS has emacs-26.3, so...
>
> 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)))

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?


  reply	other threads:[~2022-03-31 15:43 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 [this message]
2022-03-31 16:57     ` Max Nikulin
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=PAXPR06MB7760D440A9240E091CB7ED8BC6E19@PAXPR06MB7760.eurprd06.prod.outlook.com \
    --to=ignaciocasso@hotmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.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).