From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Nikulin Newsgroups: gmane.emacs.bugs Subject: bug#55635: `make-decoded-time' incorrectly sets DST to nil, it should be -1 (guess) Date: Tue, 14 Jun 2022 22:57:51 +0700 Message-ID: References: <940415ce-2e31-ae18-3e16-8fdc54504a67@gmail.com> <87o7zkbif3.fsf@gnus.org> <96e9d729-2e23-5637-3136-ac29e26aa287@cs.ucla.edu> <87r14f8dhw.fsf@gnus.org> <87zgj23pn9.fsf@gnus.org> <0e506652-fb7d-5707-8247-7747ff1e53b0@gmail.com> <83o7zhlht0.fsf@gnu.org> <87sfos1o3o.fsf@gnus.org> <6ce0d14a-017c-2b28-d924-fb461396c547@cs.ucla.edu> <4ec38916-753e-be93-a08d-a4e7cc4dd86f@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17009"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: Eli Zaretskii , 55635@debbugs.gnu.org, Lars Ingebrigtsen To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 14 17:59:27 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 1o18wv-0004C7-Ja for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jun 2022 17:59:25 +0200 Original-Received: from localhost ([::1]:39504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o18wu-0000ND-At for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Jun 2022 11:59:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o18wb-0000Mz-1N for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 11:59:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o18wX-0003Qi-NU for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 11:59:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o18wX-0000ep-J0 for bug-gnu-emacs@gnu.org; Tue, 14 Jun 2022 11:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Maxim Nikulin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Jun 2022 15:59:01 +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.16552222822450 (code B ref 55635); Tue, 14 Jun 2022 15:59:01 +0000 Original-Received: (at 55635) by debbugs.gnu.org; 14 Jun 2022 15:58:02 +0000 Original-Received: from localhost ([127.0.0.1]:35541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o18vZ-0000dR-Rc for submit@debbugs.gnu.org; Tue, 14 Jun 2022 11:58:02 -0400 Original-Received: from mail-lf1-f54.google.com ([209.85.167.54]:36462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o18vW-0000ct-V2 for 55635@debbugs.gnu.org; Tue, 14 Jun 2022 11:57:59 -0400 Original-Received: by mail-lf1-f54.google.com with SMTP id i29so14667580lfp.3 for <55635@debbugs.gnu.org>; Tue, 14 Jun 2022 08:57:58 -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=xCN8AGTA5vLGXvn0ZUsQGyIIgJ3o+41C0tzfhDzU9zw=; b=EUhWnCnWQWnfAg/iZX7T96WXS512cMwFwzQ9rTzXEkWwUcRUbc1JHqrDSJ6lJOyJM9 D0JYzJUfb2BjUWfwNUYV0tMvvgNoucIrb92z+0T3NpICPk0rFQshujBID/TxTwMMDj2F W7cSgSPJQIGuE+A8qB5zLuXVUFWO8joc12IBilNdX6r5z8bGK6H8IjGZBy1M/WBmtP7T t/NxjGqoEGROE3lqIo+Sltmx5Ql1DhW632tiQAvgsEPavApPKixxe81irUHUfbgj3PEO 2bUOBo2TOXoI1x2rjs2j9VqE32o1YyvrPA4yurO9JCJw8yzIRjyk6wrsYNM2+D2hurIx XLNQ== 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=xCN8AGTA5vLGXvn0ZUsQGyIIgJ3o+41C0tzfhDzU9zw=; b=vLO0oImnSfAJr4/CznodiX6bmwOcNJ7RcOwSkoJ9lo/VlxFOBux8afqv7Le5D02Occ TjqUHIoRC1Yr8jSs1Cr1yNGjepLctGvzOxtVO1Taj0n5BYa4YvrkPBCehFevu3lQW+XX ui8tgAbd6p+s7LyCVRlvyNbOrJ6tzYc7Fosd9iFDUv0xz9dkby+qQ/vrN4rUSVQd2vej Qxou/nrX15fyBYErrmm1krB8JxmojLQ23P9jsp5C3tWSHlRRDjqIM7CKuQbCqXn56jM/ ZYg1S0ML2L1hDDXzpavj1LrRP1wBxlXvnDLVTFpq43p5vfBWmn3zPOTuFgrLJPQ0fLSD h2Ng== X-Gm-Message-State: AJIora8RgQs1cnssIeVcI48KAjQznutmfL1p5RB4NxUAej6ChNzw2O5h vG8RwEp/EoLEJ55SVCHN1Ic= X-Google-Smtp-Source: AGRyM1v4N5I1P8Az4u3Mm68644XsQwYvxwYbsmuzsTOdpx5Bhaie585gBJ7RU0SlhTvFk/WpFszUvg== X-Received: by 2002:a05:6512:1329:b0:47d:c488:419b with SMTP id x41-20020a056512132900b0047dc488419bmr3595358lfu.398.1655222272654; Tue, 14 Jun 2022 08:57:52 -0700 (PDT) Original-Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id g14-20020a2ea4ae000000b00256d361a6cbsm1409917ljm.9.2022.06.14.08.57.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jun 2022 08:57:52 -0700 (PDT) X-Google-Original-From: Maxim Nikulin Content-Language: en-US In-Reply-To: <4ec38916-753e-be93-a08d-a4e7cc4dd86f@cs.ucla.edu> 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:234512 Archived-At: On 14/06/2022 04:30, Paul Eggert wrote: > On 5/31/22 05:25, Maxim Nikulin wrote: > >> I have never used `cl-defstruct' before (and frankly speaking I am >> rather confused that the `decoded-time' struct and its constructor >> `make-decoded-time' are defined in different files and even >> directories are not the same), so my question may be naïve. Why did >> not you just add this new sentence to the :documentation property of >> the DST slot a bit above? > > I am not sure I understand the question. The slot itself has a specified > value (t, nil, or -1) whereas the decoded-time-dst function returns an > unspecified value when there is no slot. See the diff at the end of this message. Maybe I do not see any difference because I tried such definitions and (describe-function `decoded-time-dst), (describe-symbol 'decoded-time) in Emacs-27, not for the development version. >> It may be reasonable to cross-link `decoded-time' and >> `make-decoded-time' in docstrings. > > Thanks for the suggestions; I installed the attached. First of all, I am sorry, for some reason I missed that `make-decoded-time' already has "`decoded-time'" in its docstring. Maybe I am not familiar with help system enough, but my idea was to add a docstring to `cl-defstruct' as a whole (currently only slots are documented) that has "`make-decoded-time'" reference in the opposite direction to existing one. I admit that I missed something else and it is not necessary. diff --git a/lisp/simple.el b/lisp/simple.el index 99c951b24b..3054d79d44 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -10511,27 +10511,19 @@ This is an integer between 1 and 12 (inclusive). January is 1.") (year nil :documentation "This is a four digit integer.") (weekday nil :documentation "\ This is a number between 0 and 6, and 0 is Sunday.") + ;; decoded-time-dst is problematic on 6-element lists. + ;; It should return -1 indicating unknown DST, but currently returns + ;; nil indicating standard time. (dst -1 :documentation "\ This is t if daylight saving time is in effect, nil if it is not in effect, and -1 if daylight saving information is not available. -Also see `decoded-time-dst'.") +As a special case, return an unspecified value when given a list +too short to have a dst element.") (zone nil :documentation "\ This is an integer indicating the UTC offset in seconds, i.e., the number of seconds east of Greenwich.") ) -;; Document that decoded-time-dst is problematic on 6-element lists. -;; It should return -1 indicating unknown DST, but currently returns -;; nil indicating standard time. -(put 'decoded-time-dst 'function-documentation - "Access slot \"dst\" of `decoded-time' struct CL-X. -This is t if daylight saving time is in effect, nil if it is not -in effect, and -1 if daylight saving information is not available. -As a special case, return an unspecified value when given a list -too short to have a dst element. - -(fn CL-X)") - (defun get-scratch-buffer-create () "Return the *scratch* buffer, creating a new one if needed." (or (get-buffer "*scratch*")