From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it should be -1 (guess) Date: Thu, 26 May 2022 19:11:53 -0700 Organization: UCLA Computer Science Department Message-ID: <96e9d729-2e23-5637-3136-ac29e26aa287@cs.ucla.edu> References: <940415ce-2e31-ae18-3e16-8fdc54504a67@gmail.com> <87o7zkbif3.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38076"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Cc: 55635@debbugs.gnu.org, Maxim Nikulin To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 27 04:13:11 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 1nuPTT-0009lJ-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 May 2022 04:13:11 +0200 Original-Received: from localhost ([::1]:50830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuPTS-0003XA-P5 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 May 2022 22:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuPTL-0003X1-5C for bug-gnu-emacs@gnu.org; Thu, 26 May 2022 22:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38290) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuPTK-0001m9-Sk for bug-gnu-emacs@gnu.org; Thu, 26 May 2022 22:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nuPTK-0005Fl-HT for bug-gnu-emacs@gnu.org; Thu, 26 May 2022 22:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 May 2022 02:13: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.165361752320119 (code B ref 55635); Fri, 27 May 2022 02:13:02 +0000 Original-Received: (at 55635) by debbugs.gnu.org; 27 May 2022 02:12:03 +0000 Original-Received: from localhost ([127.0.0.1]:60418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuPSM-0005ER-Qr for submit@debbugs.gnu.org; Thu, 26 May 2022 22:12:03 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuPSL-0005Dw-FE for 55635@debbugs.gnu.org; Thu, 26 May 2022 22:12:02 -0400 Original-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) Original-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) Original-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 Original-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) Original-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) Content-Language: en-US In-Reply-To: <87o7zkbif3.fsf@gnus.org> 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:233139 Archived-At: 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.