GNU bug report logs - #55635
`make-decoded-time' incorrectly sets DST to nil, it should be -1 (guess)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Maxim Nikulin <m.a.nikulin@HIDDEN>; Done: Paul Eggert <eggert@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 55635-done <at> debbugs.gnu.org:


Received: (at 55635-done) by debbugs.gnu.org; 29 May 2022 13:10:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 29 09:10:33 2022
Received: from localhost ([127.0.0.1]:39633 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nvIgj-0000Tr-Ke
	for submit <at> debbugs.gnu.org; Sun, 29 May 2022 09:10:33 -0400
Received: from quimby.gnus.org ([95.216.78.240]:33302)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nvIgf-0000Tc-Ha
 for 55635-done <at> debbugs.gnu.org; Sun, 29 May 2022 09:10:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=VdmlWgl5cQYcBYZjBTZ6s17LaRT89O22PeyRY6rxsnc=; b=WYzVAvqm6uuM5/40jB+Ez9GqYX
 HYm2N86m9TWqgUfD0Q1n0tSD/bwWEwUkUpo5U2CPIbj5LHh4wnu7gMJUkuigQKa0oJzctaZ6ursyt
 ZxN36i9OGmu/jX9BKkGvVtufYKu3izz1tw0p2PJxMCerGCD5MvNr5iBJbMkHwfpUNovs=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nvIgV-0004F0-Tp; Sun, 29 May 2022 15:10:22 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN>
 <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
 <87r14f8dhw.fsf@HIDDEN>
 <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN>
 <87zgj23pn9.fsf@HIDDEN>
 <0e506652-fb7d-5707-8247-7747ff1e53b0@HIDDEN>
 <83o7zhlht0.fsf@HIDDEN>
 <d2be51a2-fbce-82d7-a0d9-e02e05854383@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEV0L1p1PGCOV3rT
 yM/////+RlXKAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YFHQw7E9dMBY8AAAGnSURBVDjLbZTbgcQg
 CEXBaQCcBgQbmEj/ve3FPHR2l6+Yw0VeCRGRqrLW3lw6GTH38AiKaU3VdchgJSoRowf5NIBajIdV
 IXrFgALGqqYqbyvjA9Dh+IRCDHEt3pyk9xkKvhUuSEC01uZ6eE9XKDyfcAkhWuvFzzdXqPhoWpVR
 3N5xAFCd4NDTzKnUaEuB29O4qfeBzB4QuByZMUv119hBUyGUjfqqtx1kN8CSsO8gMlR2E62obQeH
 izLCpcx3EC50G9cdDNWHYDILRCO5RbhqA+58K/QLpOYS2C8waFmGWMSQatMLjLIUfueXoZr2+GNO
 cWCn/gf6j2IYIZNvMO85AX8BSz//q8BcsSiuCWgCfyrBDNHpbENm5XYK2gNMuFh3k/4M5QRYY2G3
 M+kx+94dwshxSm7hfUPeiXQHZiA+T3mcTe/pccxBRi62ne9nkkaZhbzvEtLKmGAeXld188A+mzjt
 vY+2bOC1qs4qFsgZIsdz5XQDnE11VL/24HyqyBcf6LYg17704YYG3aA/oMzJuf0GPH8bQPT4jeWy
 BJkLAMv9SY+2KX4A1oiDSpoAjkYAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDUtMjlUMTI6NTk6
 MTkrMDA6MDA8IiopAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA1LTI5VDEyOjU5OjE5KzAwOjAw
 TX+SlQAAAABJRU5ErkJggg==
X-Now-Playing: The Smiths's _The Smiths_: "Pretty Girls Make Graves"
Date: Sun, 29 May 2022 15:10:19 +0200
In-Reply-To: <d2be51a2-fbce-82d7-a0d9-e02e05854383@HIDDEN> (Paul Eggert's
 message of "Sat, 28 May 2022 10:25:51 -0700")
Message-ID: <87sfos1o3o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Paul Eggert <eggert@HIDDEN> writes: > With that in mind,
 here are three suggestions. > > 1. decoded-time-dst should return -1, instead
 of nil, when given a > 6-element list, since nil means standard time and
 -1 means DST is > unknown. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635-done
Cc: Eli Zaretskii <eliz@HIDDEN>, 55635-done <at> debbugs.gnu.org,
 Maxim Nikulin <m.a.nikulin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Eggert <eggert@HIDDEN> writes:

> With that in mind, here are three suggestions.
>
> 1. decoded-time-dst should return -1, instead of nil, when given a
> 6-element list, since nil means standard time and -1 means DST is
> unknown.

I think that sounds correct.

> 2. make-decoded-time should generate a six-element list unless given a
> DST or ZONE arg.

I don't think we should do this.  Yes, the remaining elements are
nonsensical when talking about intervals, but people rely on that
function to return its documented value.  If somebody wants to do
interval calculations and passes in a DST to make-decoded-time, that's a
classic "well, don't do that" situation.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635-done <at> debbugs.gnu.org:


Received: (at 55635-done) by debbugs.gnu.org; 28 May 2022 17:26:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 28 13:26:00 2022
Received: from localhost ([127.0.0.1]:38847 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nv0CO-0002II-Ja
	for submit <at> debbugs.gnu.org; Sat, 28 May 2022 13:26:00 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:56872)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1nv0CN-0002I2-3V
 for 55635-done <at> debbugs.gnu.org; Sat, 28 May 2022 13:25:59 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 79097160091;
 Sat, 28 May 2022 10:25:53 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id R7KozG6yxmdp; Sat, 28 May 2022 10:25:52 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5AB0D160172;
 Sat, 28 May 2022 10:25:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id QW1vMfmwitQM; Sat, 28 May 2022 10:25:52 -0700 (PDT)
Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com
 [172.91.119.151])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 16FF4160091;
 Sat, 28 May 2022 10:25:52 -0700 (PDT)
Message-ID: <d2be51a2-fbce-82d7-a0d9-e02e05854383@HIDDEN>
Date: Sat, 28 May 2022 10:25:51 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.9.1
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN> <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
 <87r14f8dhw.fsf@HIDDEN> <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN>
 <87zgj23pn9.fsf@HIDDEN> <0e506652-fb7d-5707-8247-7747ff1e53b0@HIDDEN>
 <83o7zhlht0.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
In-Reply-To: <83o7zhlht0.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635-done
Cc: larsi@HIDDEN, 55635-done <at> debbugs.gnu.org,
 Maxim Nikulin <m.a.nikulin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 5/28/22 09:53, Eli Zaretskii wrote:
> this situation already exists with time units anyway.  You can add
> an hour to some other time, but there's also a valid time stamp that
> expresses 1 hour past the epoch UTC, and their values are exactly
> identical.

Quite true for encoded times that count seconds. However, Max also has a 
point that decoded timestamps like (19 17 10 28 5 2022 6 t -25200) are 
problematic as relative times. Although their first six elements can be 
treated as either relative or absolute, their last three elements don't 
make much sense in relative times.

The recent change in the master branch that lets encode-time take 
six-element lists suggests that perhaps a better way to represent a 
relative decoded time would be as a 6-element list.

With that in mind, here are three suggestions.

1. decoded-time-dst should return -1, instead of nil, when given a 
6-element list, since nil means standard time and -1 means DST is unknown.

2. make-decoded-time should generate a six-element list unless given a 
DST or ZONE arg.

3. Document the above nicely. (This is the hardest part....)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635-done <at> debbugs.gnu.org:


Received: (at 55635-done) by debbugs.gnu.org; 28 May 2022 16:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 28 12:53:59 2022
Received: from localhost ([127.0.0.1]:38801 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuzhP-0007kw-0T
	for submit <at> debbugs.gnu.org; Sat, 28 May 2022 12:53:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46024)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1nuzhN-0007ki-CK
 for 55635-done <at> debbugs.gnu.org; Sat, 28 May 2022 12:53:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59496)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nuzhH-00071d-9x; Sat, 28 May 2022 12:53:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Gv8WU2xhQROBXm2nMuK7fZfmtdf4weUxvKRVowX1fZY=; b=EGoTCCqpjhO2
 8T46qo2YFvHhYhj+hPq6Z8l3/BCM6HUPlZ2cndd8b/1G4QamfULP9iSEv1z3OGHzHgWrIWck9wGwD
 sN8BX7HuYPXVZ+k4rO8SilOiK2mvogoVYr1ulXQblEyDRQ+rsdPVDHGSu3iQDtRnB6n75rVeSP6+Z
 SyDY7yfrDlHs3hDeowE8WC+eF9wKALf2DSEoh7csyFeNl7MG+kWYfysIBwsHP3gjudGZVqarkWef8
 xia4QTxfnLX5MPTmyoZ2yNJ4lVs4mMCQ+NBk/MFucOQIltuvEw9cfr6qVTjPFnlrmDc2Ygzm01ZvJ
 uIyf/HNBGSqMjm3O+St4SA==;
Received: from [87.69.77.57] (port=2293 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1nuzhG-0000BJ-Pj; Sat, 28 May 2022 12:53:51 -0400
Date: Sat, 28 May 2022 19:53:47 +0300
Message-Id: <83o7zhlht0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Maxim Nikulin <m.a.nikulin@HIDDEN>
In-Reply-To: <0e506652-fb7d-5707-8247-7747ff1e53b0@HIDDEN> (message from
 Maxim Nikulin on Sat, 28 May 2022 23:31:43 +0700)
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil,
 it should be -1 (guess)
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN> <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
 <87r14f8dhw.fsf@HIDDEN> <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN>
 <87zgj23pn9.fsf@HIDDEN> <0e506652-fb7d-5707-8247-7747ff1e53b0@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635-done
Cc: larsi@HIDDEN, eggert@HIDDEN, 55635-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 55635-done <at> debbugs.gnu.org
> From: Maxim Nikulin <m.a.nikulin@HIDDEN>
> Date: Sat, 28 May 2022 23:31:43 +0700
> 
> I think, it is confusing that `make-decoded-time' is used to create 
> timestamps *and* time intervals. They are different types, for example 
> sum of intervals is meaningful (despite may be ambiguous) while there is 
> no point to add timestamps.

But this situation already exists with time units anyway.  You can add
an hour to some other time, but there's also a valid time stamp that
expresses 1 hour past the epoch UTC, and their values are exactly
identical.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635-done <at> debbugs.gnu.org:


Received: (at 55635-done) by debbugs.gnu.org; 28 May 2022 16:31:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 28 12:31:53 2022
Received: from localhost ([127.0.0.1]:38777 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuzM1-00079e-Dq
	for submit <at> debbugs.gnu.org; Sat, 28 May 2022 12:31:53 -0400
Received: from mail-lf1-f45.google.com ([209.85.167.45]:35714)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.a.nikulin@HIDDEN>) id 1nuzLz-00079K-BI
 for 55635-done <at> debbugs.gnu.org; Sat, 28 May 2022 12:31:51 -0400
Received: by mail-lf1-f45.google.com with SMTP id br17so11037871lfb.2
 for <55635-done <at> debbugs.gnu.org>; Sat, 28 May 2022 09:31:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:message-id:date:mime-version:user-agent:subject
 :content-language:to:cc:references:in-reply-to
 :content-transfer-encoding;
 bh=wx0LbpPfOOWvPMi+bIT7+s52qEwhPsG79HYO7lXyCFM=;
 b=OB/h7FpajsaXWLXwr9FjgkC3ZxG4NAN1JUsnJsAzPSSM6he3SSEGPKdH2qVeV1Qpia
 OiubuRfKhBWI+a860y8VqEnWRKV/kPsIeywf0exEivLCRtKivgLtwAqe+O6Tmo5wcaFF
 Uy8r2vAgbyNGnb2ugEvGcqdsSk6LcirhJkgmtn8fW8qqzZoBdqhsCE208b6rhBtXchrt
 ezakCR8/LbeLduHCwWNtMVSUY9BOTadeyPuNfZUQqM3kKIAv+lh4AX29UEcJLf0LcDbq
 U9REWF1n2vF8cTYE3nYZJfeFvDRckujyQpaJSxfZ3D/61RW1aLYfAOs5rmfZQqGRfiWZ
 FxAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:message-id:date:mime-version:user-agent
 :subject:content-language:to:cc:references:in-reply-to
 :content-transfer-encoding;
 bh=wx0LbpPfOOWvPMi+bIT7+s52qEwhPsG79HYO7lXyCFM=;
 b=tqo1dCvV4mwETib1DnYOLuDJk3fOKAYjEF+nmpwWlYm3VoL5SvfAkQLXTtTeny1wsK
 qEY/ZVYyEn4HKsYZ601d7X8e8zo4nVobXkG2euhWbIQP3drEhbEgtQc/A9zehzB7t/4L
 mJYaRVyUqBRhBRLIpqLPklVvwFD2eTVaeY2EPi2giP81BH4ktm2qGda4MOnU4FBd8rzM
 ujjEqJAAE1WkmvS2wHMdzWqMxzqRHT9XcNkLK5xrHai+v+9xHdaXcPEnDjOeQ2rtUuoC
 8CDiMXUogW2txoyUO9kHEdMd5ZAz/2+ANgIz+yagCXdxwAaC4bpQtJFKwKWbqOupBMru
 Ec6w==
X-Gm-Message-State: AOAM532dH0ZRJu/DPb1UfMb+ZhbIgqxR1cMcl0xruusFi34JbwC8GVAc
 nUr40wtjyStjlj+e9iA1kgUue/c23JX9k6Wp
X-Google-Smtp-Source: ABdhPJxLM5qBX/9YERWRS1nV/1yCHyKjnHd8nit7ca+b67AdSgMoOOlT9qWuBP4vU5xe5GGO4IaA5Q==
X-Received: by 2002:a05:6512:32c1:b0:478:6e6c:53a5 with SMTP id
 f1-20020a05651232c100b004786e6c53a5mr21563036lfg.435.1653755505062; 
 Sat, 28 May 2022 09:31:45 -0700 (PDT)
Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188])
 by smtp.googlemail.com with ESMTPSA id
 d30-20020ac25ede000000b00477cab3374asm1384046lfq.303.2022.05.28.09.31.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 28 May 2022 09:31:44 -0700 (PDT)
From: Maxim Nikulin <m.a.nikulin@HIDDEN>
X-Google-Original-From: Maxim Nikulin <M.A.Nikulin@HIDDEN>
Message-ID: <0e506652-fb7d-5707-8247-7747ff1e53b0@HIDDEN>
Date: Sat, 28 May 2022 23:31:43 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.8.1
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
Content-Language: en-US
To: Lars Ingebrigtsen <larsi@HIDDEN>, Paul Eggert <eggert@HIDDEN>
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN> <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
 <87r14f8dhw.fsf@HIDDEN> <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN>
 <87zgj23pn9.fsf@HIDDEN>
In-Reply-To: <87zgj23pn9.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55635-done
Cc: 55635-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 28/05/2022 17:41, Lars Ingebrigtsen wrote:
> Paul Eggert writes:
> 
>> To try to lessen the confusion I installed the attached, which fixes
>> the reported bug so I'll close the bug report. Please feel free to
>> revert if you see a problem with it (I'm just trying to save time here
>> by being bold).
> 
> Thanks; I think that looks like the correct thing here.

Thank you, with the committed changes my examples work as I expect.

Paul, do you have any comment concerning the last part of the bug report?

`decoded-time-add' docstring:
 >   (decoded-time-add (decode-time) (make-decoded-time :month 2))

I think, it is confusing that `make-decoded-time' is used to create 
timestamps *and* time intervals. They are different types, for example 
sum of intervals is meaningful (despite may be ambiguous) while there is 
no point to add timestamps. Daylight saving time and timezone are 
something alien for intervals. Though I am unsure if it is reasonable to 
mark intervals by e.g. 'time-interval symbol or to make these types 
distinct by some other way.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635-done <at> debbugs.gnu.org:


Received: (at 55635-done) by debbugs.gnu.org; 28 May 2022 10:42:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 28 06:42:01 2022
Received: from localhost ([127.0.0.1]:36459 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuttQ-0001uV-Qa
	for submit <at> debbugs.gnu.org; Sat, 28 May 2022 06:42:01 -0400
Received: from quimby.gnus.org ([95.216.78.240]:50356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nuttO-0001uJ-VU
 for 55635-done <at> debbugs.gnu.org; Sat, 28 May 2022 06:42:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ifm7xnSk24H18am1iJZGU1ISPg3PUwv/zlwgQnzOJxs=; b=becGyz+8eo08CL0F4Fw4VZdUHx
 mcXRmJxWrGNxggPwPQvZ2SwuuKreYtFsac7FTuYeDJZ3M9s9IzaTtkW2geV/17/p+xUCcECfS+ZOm
 rqtmL5LyImXaTJs38U62OU0yxBL0hkMaJnwTiR3w3/6GFoCwbMERaou3wZUlhA8KUgnI=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nuttE-0002Yn-If; Sat, 28 May 2022 12:41:51 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN>
 <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
 <87r14f8dhw.fsf@HIDDEN>
 <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEXjt9O6bZgnLq2X
 TGZEJTf////hBHywAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YFHAofOUEuNigAAAG7SURBVDjLdZLr
 dcMgDIXB7gDIMEBLO0BUaYA4Yv+ZqgdxfNKEH20On++VdEVKz6fklPtnT/9P1vscoMRFSgDF/6fk
 gBCgUqVB0hDiIwOr0NDDIjxoR1Ns/QzYgODDapU2QsKjXq2GCgxk+e2hGMJa/aQA4jHsekgNqxyK
 ak4iWBVYv31a2fdGBjm4W5UVml4G2FkVsFgkOa1qMdSeSIEoWLzGBKagqnwG5l0hu9Eg+8ADgbJp
 gJliQAUsLblViq5aNGVzgCacS8yRToAyYUmHwmuI1RDwrvrndiouqtxtHUvvX6b4QD7aBYxuNwcy
 YnLS5N1qZvUxk0JilcT+FwczRMIKDJdHug3nBgmAy+VhtdIdYMZ8jdqPrHQ8fUXf+RoPa/N2XaGZ
 V6C13BVYayj05UAdvloA6Ek9ArAUaMzgVhqiXlA8uIGlNTmsbGI2CWlxapGtpWtXJP5XuyVUg8sB
 wCYxkL2Rq81uYOAcvGpDwwEE2CMqBTXrr5vuY5tASGgHCLDfawxfiCIoPBWzRixkpxoP5gmohGMx
 N518O4Hj3Ervr8GT1QnAG1CWvpzBntvPayvRuwP0N+ct+AOuNaunVkLiqAAAACV0RVh0ZGF0ZTpj
 cmVhdGUAMjAyMi0wNS0yOFQxMDozMTo1NyswMDowMN0B8eMAAAAldEVYdGRhdGU6bW9kaWZ5ADIw
 MjItMDUtMjhUMTA6MzE6NTcrMDA6MDCsXElfAAAAAElFTkSuQmCC
X-Now-Playing: Snapped Ankles's _Forest of Your Problems_: "Shifting
 Basslines of the Cornucopians"
Date: Sat, 28 May 2022 12:41:46 +0200
In-Reply-To: <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN> (Paul Eggert's
 message of "Fri, 27 May 2022 12:26:56 -0700")
Message-ID: <87zgj23pn9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Paul Eggert <eggert@HIDDEN> writes: > To try to lessen
 the confusion I installed the attached, which fixes > the reported bug so
 I'll close the bug report. Please feel free to > revert if you see a problem
 with it (I'm just trying to sa [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635-done
Cc: 55635-done <at> debbugs.gnu.org, Maxim Nikulin <m.a.nikulin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Eggert <eggert@HIDDEN> writes:

> To try to lessen the confusion I installed the attached, which fixes
> the reported bug so I'll close the bug report. Please feel free to
> revert if you see a problem with it (I'm just trying to save time here
> by being bold).

Thanks; I think that looks like the correct thing here.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635-done <at> debbugs.gnu.org:


Received: (at 55635-done) by debbugs.gnu.org; 27 May 2022 19:27:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 27 15:27:08 2022
Received: from localhost ([127.0.0.1]:35814 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nufc3-00063v-Tp
	for submit <at> debbugs.gnu.org; Fri, 27 May 2022 15:27:08 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36886)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1nufc0-00063P-I7
 for 55635-done <at> debbugs.gnu.org; Fri, 27 May 2022 15:27:06 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 88F331601D8;
 Fri, 27 May 2022 12:26:58 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id o16EEjGnc04K; Fri, 27 May 2022 12:26:57 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 82A6C1601F1;
 Fri, 27 May 2022 12:26:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Ub8w0V-4RwhB; Fri, 27 May 2022 12:26:57 -0700 (PDT)
Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com
 [172.91.119.151])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 562F91601EC;
 Fri, 27 May 2022 12:26:57 -0700 (PDT)
Content-Type: multipart/mixed; boundary="------------kELKUNklcM9uM8vRrftC61Jy"
Message-ID: <e4fdefdc-c2ea-de99-3745-66e75e6ad04c@HIDDEN>
Date: Fri, 27 May 2022 12:26:56 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.9.1
Content-Language: en-US
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN> <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
 <87r14f8dhw.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
In-Reply-To: <87r14f8dhw.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635-done
Cc: 55635-done <at> debbugs.gnu.org, Maxim Nikulin <m.a.nikulin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This is a multi-part message in MIME format.
--------------kELKUNklcM9uM8vRrftC61Jy
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

On 5/27/22 03:40, Lars Ingebrigtsen wrote:
>> This looks wrong. Shouldn't it leave the DST flag alone? I.e., just th=
is:
>>
>>    (unless (decoded-time-zone time)
>>      (setf (decoded-time-zone-time) default-zone))
>>
>> That is, if we assume that for the DST component -1 means "unknown"
>> and nil means "standard time", it should be OK for
>> decoded-time-set-defaults to leave the DST component alone, for the
>> same reason that it leaves the DOW component alone.

> Yes, I think so.  But you changed this in a391ffa2f03, and you usually
> have a good reason for changes like this, so I thought there must be
> something subtle going on here I didn't quite get.  =F0=9F=98=80

Thanks for the compliment, not sure it's deserved here....


> The old code doesn't look quite right, either, I think...
>=20
> -  ;; When we don't have a time zone and we don't have a DST, then mark
> -  ;; it as unknown.
> -  (when (and (not (decoded-time-zone time))
> -             (not (decoded-time-dst time)))
> -    (setf (decoded-time-dst time) -1))
> -
> -  (when (and (not (decoded-time-zone time))
> -             default-zone)
> -    (setf (decoded-time-zone time) 0))

Yes, that old code was wrong because it incorrectly assumeed that (not=20
(decoded-time-dst time)) means the DST flag is unspecified, whereas it=20
really means that the DST flag is specifying standard time.

It also looked odd because default-zone was used only as a boolean, even=20
though its name suggests that it's the default time zone. This usage=20
dates back to commit fa648a59c9818ae284209ac7ae4f3700aebd92c9 which you=20
installed in July 2019. The only call using default-zone in Emacs is in=20
newsticker--decode-iso8601-date, which passes 0 so that the oddity in=20
the implementation makes no difference there.

Part of the confusion here is that nil doesn't mean "no time zone is=20
known"; it means "use the Emacs default time zone". In other words, nil=20
has the same interpretation problem in time zones that it has in DST=20
flags - it doesn't mean "unknown".

To try to lessen the confusion I installed the attached, which fixes the=20
reported bug so I'll close the bug report. Please feel free to revert if=20
you see a problem with it (I'm just trying to save time here by being bol=
d).
--------------kELKUNklcM9uM8vRrftC61Jy
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-decoded-time-set-defaults-now-leaves-DST-alone.patch"
Content-Disposition: attachment;
 filename*0="0001-decoded-time-set-defaults-now-leaves-DST-alone.patch"
Content-Transfer-Encoding: base64

RnJvbSBmZTM4Y2JjMTRmYjYyN2YzOWUxNDViOWE4NWYwMjlhZjk2ZjkwM2M3IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1
PgpEYXRlOiBGcmksIDI3IE1heSAyMDIyIDEyOjE5OjQzIC0wNzAwClN1YmplY3Q6IFtQQVRD
SF0gZGVjb2RlZC10aW1lLXNldC1kZWZhdWx0cyBub3cgbGVhdmVzIERTVCBhbG9uZQpNSU1F
LVZlcnNpb246IDEuMApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgK
Q29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJpdAoKKiBsaXNwL2NhbGVuZGFyL3RpbWUt
ZGF0ZS5lbCAoZGVjb2RlZC10aW1lLXNldC1kZWZhdWx0cyk6CkRvbuKAmXQgbWVzcyB3aXRo
IGRlY29kZWQtdGltZS1kc3QgKEJ1ZyM1NTYzNSkuCi0tLQogbGlzcC9jYWxlbmRhci90aW1l
LWRhdGUuZWwgfCAxMyArKysrKysrLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgNyBpbnNlcnRp
b25zKCspLCA2IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3AvY2FsZW5kYXIvdGlt
ZS1kYXRlLmVsIGIvbGlzcC9jYWxlbmRhci90aW1lLWRhdGUuZWwKaW5kZXggZGM3N2E3Yzdl
MC4uNDAzNzRjM2JiNCAxMDA2NDQKLS0tIGEvbGlzcC9jYWxlbmRhci90aW1lLWRhdGUuZWwK
KysrIGIvbGlzcC9jYWxlbmRhci90aW1lLWRhdGUuZWwKQEAgLTU2Miw2ICs1NjIsOSBAQCBk
ZWNvZGVkLXRpbWUtc2V0LWRlZmF1bHRzCiBUaGlzIHllYXIgaXMgdXNlZCB0byBndWFyYW50
ZWUgcG9ydGFiaWxpdHk7IHNlZSBJbmZvCiBub2RlIGAoZWxpc3ApIFRpbWUgb2YgRGF5Jy4K
IAorT3B0aW9uYWwgYXJndW1lbnQgREVGQVVMVC1aT05FIHNwZWNpZmllcyB3aGF0IHRpbWUg
em9uZSB0bworZGVmYXVsdCB0byB3aGVuIFRJTUUncyB0aW1lIHpvbmUgaXMgbmlsIChtZWFu
aW5nIGxvY2FsIHRpbWUpLgorCiBUSU1FIGlzIG1vZGlmaWVkIGFuZCByZXR1cm5lZC4iCiAg
ICh1bmxlc3MgKGRlY29kZWQtdGltZS1zZWNvbmQgdGltZSkKICAgICAoc2V0ZiAoZGVjb2Rl
ZC10aW1lLXNlY29uZCB0aW1lKSAwKSkKQEAgLTU3NywxMyArNTgwLDExIEBAIGRlY29kZWQt
dGltZS1zZXQtZGVmYXVsdHMKICAgKHVubGVzcyAoZGVjb2RlZC10aW1lLXllYXIgdGltZSkK
ICAgICAoc2V0ZiAoZGVjb2RlZC10aW1lLXllYXIgdGltZSkgMTk3MCkpCiAKLSAgOzsgV2hl
biB3ZSBkb24ndCBoYXZlIGEgdGltZSB6b25lLCBkZWZhdWx0IHRvIERFRkFVTFQtWk9ORSB3
aXRob3V0Ci0gIDs7IERTVCBpZiBERUZBVUxULVpPTkUgaWYgZ2l2ZW4sIGFuZCB0byB1bmtu
b3duIERTVCBvdGhlcndpc2UuCiAgICh1bmxlc3MgKGRlY29kZWQtdGltZS16b25lIHRpbWUp
Ci0gICAgKGlmIGRlZmF1bHQtem9uZQotCShwcm9nbiAoc2V0ZiAoZGVjb2RlZC10aW1lLXpv
bmUgdGltZSkgZGVmYXVsdC16b25lKQotCSAgICAgICAoc2V0ZiAoZGVjb2RlZC10aW1lLWRz
dCB0aW1lKSBuaWwpKQotICAgICAgKHNldGYgKGRlY29kZWQtdGltZS1kc3QgdGltZSkgLTEp
KSkKKyAgICAoc2V0ZiAoZGVjb2RlZC10aW1lLXpvbmUgdGltZSkgZGVmYXVsdC16b25lKSkK
KworICA7OyBEbyBub3Qgc2V0IGRlY29kZWQtdGltZS13ZWVrZGF5IG9yIGRlY29kZWQtdGlt
ZS1kc3QsCisgIDs7IGFzIGVuY29kZS10aW1lIGNhbiBpbmZlciB0aGVtIHdlbGwgZW5vdWdo
IHdoZW4gdW5rbm93bi4KIAogICB0aW1lKQogCi0tIAoyLjM0LjEKCg==

--------------kELKUNklcM9uM8vRrftC61Jy--




Notification sent to Maxim Nikulin <m.a.nikulin@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Paul Eggert <eggert@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 55635 <at> debbugs.gnu.org:


Received: (at 55635) by debbugs.gnu.org; 27 May 2022 10:41:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 27 06:41:01 2022
Received: from localhost ([127.0.0.1]:32836 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuXOu-0006GD-S4
	for submit <at> debbugs.gnu.org; Fri, 27 May 2022 06:41:01 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39114)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nuXOq-0006Fx-9l
 for 55635 <at> debbugs.gnu.org; Fri, 27 May 2022 06:40:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=kA9K4Lz8onUm1xL19MhYv2NCVqc9r40j3pKfMKwWFR8=; b=UmK3MkW4xK7rBwK4JfvEho3gFI
 e1RtJsMKoIx4ou1hMgCB52Eyg2JDzAxEouMZALfa+oc9K7IGla3JHIEkkvQULBHvohQS1A7tGd972
 tLvC4qahcWzbiOlH5BlP049LTbl8fb1/Y7iCO5F9cMPon/zhLhmwjfO7wCCaurpwnexs=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nuXOf-0006zX-TM; Fri, 27 May 2022 12:40:48 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN>
 <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
X-Now-Playing: Hannah Diamond's _PC Music Volume 3_: "Invisible"
Date: Fri, 27 May 2022 12:40:43 +0200
In-Reply-To: <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN> (Paul Eggert's
 message of "Thu, 26 May 2022 19:11:53 -0700")
Message-ID: <87r14f8dhw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Paul Eggert <eggert@HIDDEN> writes: >> perhaps -1 is
 less "filled out" than nil in this >> case. > > Indeed it is,
 and make-decoded-time's
 DST flag should default to -1. So I've now made this change in Emacs 29. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635
Cc: 55635 <at> debbugs.gnu.org, Maxim Nikulin <m.a.nikulin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Eggert <eggert@HIDDEN> writes:

>> perhaps -1 is less "filled out" than nil in this
>> case.
>
> Indeed it is, and make-decoded-time's DST flag should default to -1.

So I've now made this change in Emacs 29.

>> It's this code, I guess:
>>    ;; When we don't have a time zone, default to DEFAULT-ZONE
>> without
>>    ;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
>>    (unless (decoded-time-zone time)
>>      (if default-zone
>> 	(progn (setf (decoded-time-zone time) default-zone)
>> 	       (setf (decoded-time-dst time) nil))
>>        (setf (decoded-time-dst time) -1)))
>
> This looks wrong. Shouldn't it leave the DST flag alone? I.e., just this:
>
>   (unless (decoded-time-zone time)
>     (setf (decoded-time-zone-time) default-zone))
>
> That is, if we assume that for the DST component -1 means "unknown"
> and nil means "standard time", it should be OK for
> decoded-time-set-defaults to leave the DST component alone, for the
> same reason that it leaves the DOW component alone.

Yes, I think so.  But you changed this in a391ffa2f03, and you usually
have a good reason for changes like this, so I thought there must be
something subtle going on here I didn't quite get.  =F0=9F=98=80

The old code doesn't look quite right, either, I think...

-  ;; When we don't have a time zone and we don't have a DST, then mark
-  ;; it as unknown.
-  (when (and (not (decoded-time-zone time))
-             (not (decoded-time-dst time)))
-    (setf (decoded-time-dst time) -1))
-
-  (when (and (not (decoded-time-zone time))
-             default-zone)
-    (setf (decoded-time-zone time) 0))


--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635 <at> debbugs.gnu.org:


Received: (at 55635) by debbugs.gnu.org; 27 May 2022 02:12:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 26 22:12:03 2022
Received: from localhost ([127.0.0.1]:60418 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuPSM-0005ER-Qr
	for submit <at> debbugs.gnu.org; Thu, 26 May 2022 22:12:03 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46712)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1nuPSL-0005Dw-FE
 for 55635 <at> debbugs.gnu.org; Thu, 26 May 2022 22:12:02 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id A97BC1601A5;
 Thu, 26 May 2022 19:11:54 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Aavyc1WOMLtv; Thu, 26 May 2022 19:11:54 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id F327E1601BC;
 Thu, 26 May 2022 19:11:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id Al58h6PZseJH; Thu, 26 May 2022 19:11:53 -0700 (PDT)
Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C0CE11601B4;
 Thu, 26 May 2022 19:11:53 -0700 (PDT)
Message-ID: <96e9d729-2e23-5637-3136-ac29e26aa287@HIDDEN>
Date: Thu, 26 May 2022 19:11:53 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.9.0
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
Content-Language: en-US
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
 <87o7zkbif3.fsf@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
In-Reply-To: <87o7zkbif3.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635
Cc: 55635 <at> debbugs.gnu.org, Maxim Nikulin <m.a.nikulin@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 5/26/22 05:13, Lars Ingebrigtsen wrote:
> perhaps -1 is less "filled out" than nil in this
> case.

Indeed it is, and make-decoded-time's DST flag should default to -1.

It's unfortunate that nil means "standard time" in these contexts. In 
hindsight some other symbol should have been used to mean "standard 
time". Could be too late to change this though.


> It's this code, I guess:
> 
>    ;; When we don't have a time zone, default to DEFAULT-ZONE without
>    ;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
>    (unless (decoded-time-zone time)
>      (if default-zone
> 	(progn (setf (decoded-time-zone time) default-zone)
> 	       (setf (decoded-time-dst time) nil))
>        (setf (decoded-time-dst time) -1)))

This looks wrong. Shouldn't it leave the DST flag alone? I.e., just this:

   (unless (decoded-time-zone time)
     (setf (decoded-time-zone-time) default-zone))

That is, if we assume that for the DST component -1 means "unknown" and 
nil means "standard time", it should be OK for decoded-time-set-defaults 
to leave the DST component alone, for the same reason that it leaves the 
DOW component alone.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at 55635 <at> debbugs.gnu.org:


Received: (at 55635) by debbugs.gnu.org; 26 May 2022 12:14:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 26 08:14:07 2022
Received: from localhost ([127.0.0.1]:57192 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuCNS-0004AL-Nf
	for submit <at> debbugs.gnu.org; Thu, 26 May 2022 08:14:06 -0400
Received: from quimby.gnus.org ([95.216.78.240]:56742)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nuCNP-00049d-CA
 for 55635 <at> debbugs.gnu.org; Thu, 26 May 2022 08:14:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=g2dhkIWxsW25rzTo8lXkqUvEvaooOrEvGvzbFBS+SnY=; b=aWKtJuXCuFqLxEFzOYBDFq6cEM
 MIcoErGuBYnSmp7/tyQNJsSlcDyPwTAGl/YDwQ/26w4wK5lh7Fn4WkAnlOjNHLpaDbV01lzyeL2Hy
 DdJLEPyLlej/mI3PwX/4Nm72ZODAugMTzaG5RLFDGIbqmdf48c0J3PFrvROq2yMtJ8Hs=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nuCNF-0004Nq-Af; Thu, 26 May 2022 14:13:55 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Maxim Nikulin <m.a.nikulin@HIDDEN>
Subject: Re: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it
 should be -1 (guess)
References: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
X-Now-Playing: Talking Heads's _The Name Of This Band Is Talking Heads (Disc
 2: 1980-1981)_: "Drugs (Electricity)"
Date: Thu, 26 May 2022 14:13:52 +0200
In-Reply-To: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN> (Maxim Nikulin's
 message of "Wed, 25 May 2022 21:46:50 +0700")
Message-ID: <87o7zkbif3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Maxim Nikulin <m.a.nikulin@HIDDEN> writes: > Consider the
 following example: > > (format-time-string > "%F %T %Z %z" > (encode-time
 > (make-decoded-time :year 2022 :month 3 :day 31 > :hour 23 :minute 30 :second
 0 > :zone "Europe/Madrid")) > "E [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55635
Cc: 55635 <at> debbugs.gnu.org, Paul Eggert <eggert@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maxim Nikulin <m.a.nikulin@HIDDEN> writes:

> Consider the following example:
>
>     (format-time-string
>      "%F %T %Z %z"
>      (encode-time
>       (make-decoded-time :year 2022 :month 3 :day 31
>     			 :hour 23 :minute 30 :second 0
>     			 :zone "Europe/Madrid"))
>      "Europe/Madrid")
>     "2022-04-01 00:30:00 CEST +0200"
>
> I believe that the result should be
>     "2022-03-31 23:30:00 CEST +0200"
> It can be obtained if :dst -1 is explicitly added to the
> `make-decoded-time' arguments.
>
> Since `make-decoded-time' is defined using `cl-defun', I think, it is
> better to use -1 ("guess") default value for the :dst argument, not
> nil that explicitly says "no daylight saving time".

I think that makes some sense, but on the other hand, that's just a
simple helper function that does what it says -- "with only the keywords
given filled out".  But perhaps -1 is less "filled out" than nil in this
case.

> There is `decoded-time-set-defaults', but it does not help
>
>     (format-time-string
>      "%F %T %Z %z"
>      (encode-time
>       (decoded-time-set-defaults
>        (make-decoded-time :year 2022 :month 3 :day 31
> 			  :hour 23 :minute 30)
>        "Europe/Madrid"))
>      "Europe/Madrid")
>     "2022-04-01 01:30:00 CEST +0200"
>
> This case I have no idea how to fix the issue.

It's this code, I guess:

  ;; When we don't have a time zone, default to DEFAULT-ZONE without
  ;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
  (unless (decoded-time-zone time)
    (if default-zone
	(progn (setf (decoded-time-zone time) default-zone)
	       (setf (decoded-time-dst time) nil))
      (setf (decoded-time-dst time) -1)))

I've added Paul to the CCs; perhaps he has some comments.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 May 2022 14:47:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 10:47:02 2022
Received: from localhost ([127.0.0.1]:56212 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntsHt-00016A-P1
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 10:47:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:46364)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.a.nikulin@HIDDEN>) id 1ntsHs-00015z-AQ
 for submit <at> debbugs.gnu.org; Wed, 25 May 2022 10:47:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:44322)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <m.a.nikulin@HIDDEN>)
 id 1ntsHr-0004eC-0p
 for bug-gnu-emacs@HIDDEN; Wed, 25 May 2022 10:46:59 -0400
Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:39437)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <m.a.nikulin@HIDDEN>)
 id 1ntsHp-0007hU-As
 for bug-gnu-emacs@HIDDEN; Wed, 25 May 2022 10:46:58 -0400
Received: by mail-lf1-x134.google.com with SMTP id y32so36367689lfa.6
 for <bug-gnu-emacs@HIDDEN>; Wed, 25 May 2022 07:46:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:message-id:date:mime-version:user-agent:to:content-language
 :subject:content-transfer-encoding;
 bh=6bckdsNsjy+VClOR73p50sN89C1BCVZPw1qqROCfGiU=;
 b=FD37sI28+q42AeJWqRolamRYNpb6JnVJoUD8JbbfQEBV0zxHgpgdoZD18PduBViO33
 xKX6+uEOHsJPZKgLHDZOmF3dJsFUzDk3aGAg4NoovfGw8VCFgX2fm7ucqCAk1Vo6k987
 XAcQ5jQTDe8C7bMmreHWtmo/hb6WB77MvlfqEZclGWL4CVaamqhZu2ecuLh4uR9ry24u
 cDr7jvFrQN7i2DdjZFitp4nRsmhdRAL8R0wcbLWYSIhsBEcp3qHZXY7Vv11enlVhcvfc
 9zOyKTbRpqmILo22O2tTCpc9+9EcO0SW3JhuFQ0Y6eCDzoNUDhK0NXz+7Si2TEns70xr
 uHCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:message-id:date:mime-version:user-agent:to
 :content-language:subject:content-transfer-encoding;
 bh=6bckdsNsjy+VClOR73p50sN89C1BCVZPw1qqROCfGiU=;
 b=L/J2iiB1L2PCoCLsT63mLBsPIUbs5XH+VNcZWcIXYSU2GSdSQ4cnB9JkM2pJkcOmp4
 4+wgNBAlFqfUxaKxCuXcbU/o3dMCQ1SB7Lz/0rL5w4mgc5e+m0DtLHDPTdVQ6bIgrtS6
 CiXMNvTLIZN+SBVjlwccLkOYsiLxL/KjXJb77WEjqe9GR/YlV7TjT9oxpixWOEcsabai
 2BLvl8OLGIccE19kq0y4lFgp2tbA5kHa1UKMBtJrk46I2dnpOzKaZDimdi+dXPoJrphs
 o7dLrbUFzoGcPps28E1PwDGaSvcwxx1bNOZ+xaPkeF/bUCE+Jw0D9j6LVVpDp5L9VXxk
 s9tg==
X-Gm-Message-State: AOAM5305rPR3AZu8KMZvB2AY5C+jrnXezyYAEfQxI+3Fac3TRmV8MCr+
 BH2+Z3rEEVq8U2oDes3WKGcncw/QW1M=
X-Google-Smtp-Source: ABdhPJxTVOwr4BVg6KrUun/k/7BL1VkmBVxwOAsxKELyCy+U/TBIdikmyNbFh/AYZzEzWfQhYgKsLw==
X-Received: by 2002:a05:6512:e83:b0:477:bd0e:e54b with SMTP id
 bi3-20020a0565120e8300b00477bd0ee54bmr6814916lfb.191.1653490012073; 
 Wed, 25 May 2022 07:46:52 -0700 (PDT)
Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188])
 by smtp.googlemail.com with ESMTPSA id
 z21-20020a19f715000000b00477cc3fa475sm2956489lfe.204.2022.05.25.07.46.51
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 25 May 2022 07:46:51 -0700 (PDT)
From: Maxim Nikulin <m.a.nikulin@HIDDEN>
X-Google-Original-From: Maxim Nikulin <M.A.Nikulin@HIDDEN>
Message-ID: <940415ce-2e31-ae18-3e16-8fdc54504a67@HIDDEN>
Date: Wed, 25 May 2022 21:46:50 +0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.8.1
To: bug-gnu-emacs@HIDDEN
Content-Language: en-US
Subject: `make-decoded-time' incorrectly sets DST to nil, it should be -1
 (guess)
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a00:1450:4864:20::134;
 envelope-from=m.a.nikulin@HIDDEN; helo=mail-lf1-x134.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Consider the following example:

     (format-time-string
      "%F %T %Z %z"
      (encode-time
       (make-decoded-time :year 2022 :month 3 :day 31
     			 :hour 23 :minute 30 :second 0
     			 :zone "Europe/Madrid"))
      "Europe/Madrid")
     "2022-04-01 00:30:00 CEST +0200"

I believe that the result should be
     "2022-03-31 23:30:00 CEST +0200"
It can be obtained if :dst -1 is explicitly added to the 
`make-decoded-time' arguments.

Since `make-decoded-time' is defined using `cl-defun', I think, it is 
better to use -1 ("guess") default value for the :dst argument, not nil 
that explicitly says "no daylight saving time".

There is `decoded-time-set-defaults', but it does not help

     (format-time-string
      "%F %T %Z %z"
      (encode-time
       (decoded-time-set-defaults
        (make-decoded-time :year 2022 :month 3 :day 31
			  :hour 23 :minute 30)
        "Europe/Madrid"))
      "Europe/Madrid")
     "2022-04-01 01:30:00 CEST +0200"

This case I have no idea how to fix the issue.

An example in the `decoded-time-add' docstring
 >   (decoded-time-add (decode-time) (make-decoded-time :month 2))
adds even more confusion. If `make-decoded-time' is intended for 
intervals, not timestamps than it should not have DST and TZ values at 
all. Time interval may be added to timestamp, and time zone and daylight 
saving time flag is the property of particular timestamp while the same 
interval may be added to various timestamps and the actual result 
depends on the base timestamp.

Timestamp and interval are different types and should not be used 
interchangeably. nil/t/-1 interpretation difference for DST causes 
issues like (bug#54731), so it should be handled with care.




Acknowledgement sent to Maxim Nikulin <m.a.nikulin@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#55635; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 29 May 2022 13:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.