From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it should be -1 (guess) Date: Fri, 27 May 2022 12:40:43 +0200 Message-ID: <87r14f8dhw.fsf@gnus.org> References: <940415ce-2e31-ae18-3e16-8fdc54504a67@gmail.com> <87o7zkbif3.fsf@gnus.org> <96e9d729-2e23-5637-3136-ac29e26aa287@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29825"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 55635@debbugs.gnu.org, Maxim Nikulin To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 27 12:48:29 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nuXW8-0007a7-VR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 May 2022 12:48:28 +0200 Original-Received: from localhost ([::1]:34056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuXW7-0001Jh-Rp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 May 2022 06:48:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuXOx-0003io-E2 for bug-gnu-emacs@gnu.org; Fri, 27 May 2022 06:41:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuXOw-0000Kq-Gn for bug-gnu-emacs@gnu.org; Fri, 27 May 2022 06:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nuXOw-0006Gh-Dr for bug-gnu-emacs@gnu.org; Fri, 27 May 2022 06:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 May 2022 10:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55635 X-GNU-PR-Package: emacs Original-Received: via spool by 55635-submit@debbugs.gnu.org id=B55635.165364806124081 (code B ref 55635); Fri, 27 May 2022 10:41:02 +0000 Original-Received: (at 55635) by debbugs.gnu.org; 27 May 2022 10:41:01 +0000 Original-Received: from localhost ([127.0.0.1]:32836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXOu-0006GD-S4 for submit@debbugs.gnu.org; Fri, 27 May 2022 06:41:01 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:39114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuXOq-0006Fx-9l for 55635@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=; Original-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 ) id 1nuXOf-0006zX-TM; Fri, 27 May 2022 12:40:48 +0200 X-Now-Playing: Hannah Diamond's _PC Music Volume 3_: "Invisible" In-Reply-To: <96e9d729-2e23-5637-3136-ac29e26aa287@cs.ucla.edu> (Paul Eggert's message of "Thu, 26 May 2022 19:11:53 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233181 Archived-At: Paul Eggert 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