unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: ulm@gentoo.org, 72570@debbugs.gnu.org
Subject: bug#72570: 31.0.50; Regression in date-to-time
Date: Tue, 13 Aug 2024 14:15:57 +0300	[thread overview]
Message-ID: <86ikw4hdw2.fsf@gnu.org> (raw)
In-Reply-To: <892ebc72-1020-471a-bdcd-8e8da10d61dd@cs.ucla.edu> (message from Paul Eggert on Mon, 12 Aug 2024 15:03:46 -0700)

> Date: Mon, 12 Aug 2024 15:03:46 -0700
> Cc: 72570@debbugs.gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> On 2024-08-12 04:42, Eli Zaretskii wrote:
> > Paul, any suggestions?  And can we please document the missing
> > time-zone assumptions?
> 
> Not sure what documentation is missing, but I went through the doc for 
> parse-time-string and iso8601-parse and found some room for improvement 
> and so installed the attached.

Thanks, but that doesn't document what I found missing: the
interpretation of the missing time-zone information.  Maybe you
consider it unnecessary to mention these defaults in the doc strings
of parse-time-string and iso8601-parse, but it is something I kept
asking myself when I tried to understand what does date-to-time do
when called without time-zone argument.  At the very least we should
say that without TZ information, these functions return nil as the
time zone/UTC offset, and that the interpretation of that nil is up to
the APIs that the program will call with these results.  Also, it
would be good to document what will these functions do when the TZ
information _is_ supplied: will they still just parse the string into
numbers, or will they convert the date/time to UTC?

> As for the original issue, I tend to agree with Ulrich that date-to-time 
> should default to local time. This would need changes to both 
> documentation and to code. Ulrich mentioned the following potential 
> issue with this idea:
> 
> > The problem is that
> > timezone-make-date-arpa-standard would need an explicit timezone as its
> > second argument, which we don't know.
> 
> The code could use timezone-time-zone-from-absolute to infer a timezone. 
> timezone-fix-time already does this sort of thing. Admittedly getting 
> the details right could be a bit tricky, and there is no perfect 
> solution in this area (certainly timezone-fix-time is flawed). It might 
> be good enough, though.

The change which affected behavior that triggered this discussion was
done because evidently timezone-time-zone-from-absolute was deemed to
be too slow, and therefore the authors of the change wanted to avoid
it.  I'm okay with making the result of that change the de-facto
default, but then (a) we should document this change in NEWS including
the (trivial) way of getting back old behavior, and (b) make sure that
the new behavior happens even if the body of this condition-case in
date-to-time:

  (condition-case err
      (let ((parsed (parse-time-string date)))
	(when (decoded-time-year parsed)
	  (decoded-time-set-defaults parsed))
	(encode-time parsed))

does not signal an error.





  parent reply	other threads:[~2024-08-13 11:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11  8:57 bug#72570: 31.0.50; Regression in date-to-time Ulrich Mueller
2024-08-12  7:27 ` Ulrich Mueller
2024-08-12  8:18   ` Ulrich Mueller
2024-08-12 11:42 ` Eli Zaretskii
2024-08-12 12:51   ` Ulrich Mueller
2024-08-12 13:26     ` Eli Zaretskii
2024-08-12 13:48       ` Ulrich Mueller
2024-08-12 14:30         ` Eli Zaretskii
2024-08-12 22:03   ` Paul Eggert
2024-08-13  5:55     ` Ulrich Mueller
2024-08-13 19:39       ` Paul Eggert
2024-08-13 21:11         ` Ulrich Mueller
2024-08-13 21:19           ` Paul Eggert
2024-08-14  8:12             ` Ulrich Mueller
2024-08-14 14:09             ` Ulrich Mueller
2024-08-15  3:27               ` Paul Eggert
2024-08-15  4:35                 ` Ulrich Mueller
2024-08-15  6:26                   ` Paul Eggert
2024-08-15  6:45                   ` Eli Zaretskii
2024-08-15  7:18                     ` Ulrich Mueller
2024-08-15  7:22                       ` Eli Zaretskii
2024-08-13 11:15     ` Eli Zaretskii [this message]
2024-08-13 15:09       ` Ulrich Mueller
2024-08-13 15:36         ` Eli Zaretskii
2024-08-13 19:59       ` Paul Eggert
2024-08-14  8:37         ` Eli Zaretskii

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86ikw4hdw2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=72570@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=ulm@gentoo.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).