GNU bug report logs - #74869
[PATCH] Add predicates for decoded times and time deltas

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; Severity: wishlist; Reported by: Richard Lawrence <rwl@HIDDEN>; Keywords: patch; dated Sat, 14 Dec 2024 16:13:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 74869) by debbugs.gnu.org; 12 Feb 2025 05:21:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 12 00:21:08 2025
Received: from localhost ([127.0.0.1]:60347 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ti5BM-0005Z4-5V
	for submit <at> debbugs.gnu.org; Wed, 12 Feb 2025 00:21:08 -0500
Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]:44699)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <rwl@HIDDEN>)
 id 1ti5BG-0005Y3-4E
 for 74869 <at> debbugs.gnu.org; Wed, 12 Feb 2025 00:21:06 -0500
Received: from phl-compute-11.internal (phl-compute-11.phl.internal
 [10.202.2.51])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 30FB125401D6;
 Wed, 12 Feb 2025 00:20:56 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-11.internal (MEProxy); Wed, 12 Feb 2025 00:20:56 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 recursewithless.net; h=cc:cc:content-type:content-type:date:date
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm2; t=1739337656;
 x=1739424056; bh=H7HFrBt7Vp3+RRu3faR61dNeADcp+PfZw9efD7c7JtY=; b=
 LzQYoXaQ4TL+Oo3NR0Gq+FHQXGnIjy83CU9rQywPEETfbAvEPbK7VqNP8YESb7n5
 EJsQCIQy3nneb5lh1EPV737pFv85ONGyu1ZbjLS7iZDltWPtlgmOKwiuXMA+05Tb
 QYZNOaWTJ+l2fi7g8ykF7CzFnc1mGwB2bzFvX6DUimr5Vm6t/aIWNcBMtFAzMmQj
 XjEUMtiW+kFXjVEyZBfv1Xcl2bKFlDFpv58CpoAs058i0Lx8hbE3LkQ56ETrAGZR
 lg7RXrlAHNZavKKCZA2zpoF7v6fUnzzDU5BWUeEDHBB593M4qVmmJdzhu3GvBcTZ
 RjbVRAXWYCyU9uGz/wWP4A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
 1739337656; x=1739424056; bh=H7HFrBt7Vp3+RRu3faR61dNeADcp+PfZw9e
 fD7c7JtY=; b=g2AvZrEWyw/gDJseGXblN97M2N+tTP2ztYgJMzAv1PX+4wIYJqH
 /vuvii5DJBBYCK+QrYwRUkzAMpPbBuxxwCfLbfRIXmjSa+Exbxr6CuuYUyArIFbg
 FKXPMY0quVxKGUk/udnnQnDZtLVkrflPzrxLhxuskfVCq5kC8in6xLSv5k6Xfve/
 Em993T0jIaF+VhfJ+L8AzdMltZ9Kqlq0W/geL6JAGYNxBHRCa310a4WZ6TKSHWJ5
 h365QaY0op5ymlrGBrOlZNtI7fPftgaCHBnH4qss2FnZV72Yllhnx7ebdB4ADaV2
 7C42JyodgO6vUupQDdvEFdSB7eMx2Q0rKDQ==
X-ME-Sender: <xms:ti-sZ3T-0CjopqIv5ua1wRuNV5_SNzSdhZ6n-RUG56GqPG0iXYkD_g>
 <xme:ti-sZ4yrfpgCosSXz--aXiDN1G41cTiQUmcqeCvZcQv5pRLsNIZElUvJGMpdrJi_T
 O9lU4vRVG6LGshyjQ>
X-ME-Received: <xmr:ti-sZ80qf0D8kWayQIM4c-MQR7Wo_njoxWUkbtORWgg9bb3tkDETspS3>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegfedtvdcutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp
 uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg
 hnthhsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfggtgesthdtredttddttden
 ucfhrhhomheptfhitghhrghrugcunfgrfihrvghntggvuceorhiflhesrhgvtghurhhsvg
 ifihhthhhlvghsshdrnhgvtheqnecuggftrfgrthhtvghrnhepiedtiefgteehkeehkeeh
 heeiudefvddvffffgfejfeetvdeltefgtdfgjeeltddvnecuffhomhgrihhnpehgnhhurd
 horhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep
 rhiflhesrhgvtghurhhsvgifihhthhhlvghsshdrnhgvthdpnhgspghrtghpthhtohepfe
 dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghgghgvrhhtsegtshdruhgtlhgr
 rdgvughupdhrtghpthhtohepshhtvghfrghnkhgrnhhgrghssehgmhgrihhlrdgtohhmpd
 hrtghpthhtohepjeegkeeileesuggvsggsuhhgshdrghhnuhdrohhrgh
X-ME-Proxy: <xmx:ti-sZ3DTeDaGk83iMmqpQYPc_cldZdZoQSaLhn0KkFbJH5fGg1trkA>
 <xmx:ti-sZwhr7AaM8paHS1VimCuJDbST02PyCtHr7qa15BK8zmKSS39F9A>
 <xmx:ti-sZ7peGXc-r2xQDD4smzwO3cXXRr3q1B9RClxiFkF1SqC42o5nrQ>
 <xmx:ti-sZ7gC_pLyi_7EEk8eO59TUQ0ShYUFam5prnuFXX4NXhi5agApgg>
 <xmx:uC-sZ5shpTi-UbLE4_3pSlD51BElu4JYnp28_-feoyU3FES1CW-LDhAJ>
Feedback-ID: if7394488:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 12 Feb 2025 00:20:54 -0500 (EST)
From: Richard Lawrence <rwl@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>, Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#74869: Fwd: [PATCH] Add predicates for decoded times and
 time deltas
In-Reply-To: <a10d8686-72fa-427a-a2c6-1c1331d887c3@HIDDEN>
References: <e6537a9d-3f74-46a0-9bbd-ef63d045f4c2@HIDDEN>
 <7be82ecf-0d4f-488a-94ae-3f39fe886edb@HIDDEN>
 <CADwFkmmZgoQicu+p9+SsRchsupiRDRhkMNPjtrxPjr_npfpt6w@HIDDEN>
 <a10d8686-72fa-427a-a2c6-1c1331d887c3@HIDDEN>
Date: Wed, 12 Feb 2025 06:20:45 +0100
Message-ID: <87bjv7kac2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74869
Cc: 74869 <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.7 (-)

Paul Eggert <eggert@HIDDEN> writes:

> On 2/11/25 11:14, Stefan Kangas wrote:
>
>> Does that mean to imply that this bug is a wontfix?
>
> Given rwl's December 29 message 
> <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74869#16> it sounds like 
> it might be better to have something like an icalendar-decoded-time-p 
> function, which follows the iCalendar standard as opposed to Emacs's 
> more-idiosyncratic rules. So, not a wontfix; more a "let's keep this in 
> iCalendar for now".

Yes, that's fine with me; so I guess this bug can be closed.

By the way, Paul, since you seem to be the (a?) local expert on
time-related stuff: I think I am getting close to having a working
implementation of iCalendar recurrence rules, which are needed to have
fully working semantics for iCalendar date-time values (because time
zone definitions use recurrence rules). But the code has been difficult
to write and I would really appreciate having an expert look over it
when it's ready...would you have any time for that in the nearish future?





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

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


Received: (at 74869) by debbugs.gnu.org; 12 Feb 2025 00:44:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 11 19:44:33 2025
Received: from localhost ([127.0.0.1]:59653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ti0rh-00074L-C9
	for submit <at> debbugs.gnu.org; Tue, 11 Feb 2025 19:44:33 -0500
Received: from mail.cs.ucla.edu ([131.179.128.66]:49692)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eggert@HIDDEN>)
 id 1ti0rc-00073p-Qw
 for 74869 <at> debbugs.gnu.org; Tue, 11 Feb 2025 19:44:30 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 617683C011BC5;
 Tue, 11 Feb 2025 16:44:22 -0800 (PST)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id h66HNswCuTUn; Tue, 11 Feb 2025 16:44:22 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 08C493C011BD7;
 Tue, 11 Feb 2025 16:44:22 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 08C493C011BD7
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1739321062;
 bh=bXM1HLN/jVUkqtZ5Dk57rlmr8byam6MWHXBy5hykNTA=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=ILn8WgzEWXcWpEBwFTOro+k9ZRf5GWjLDeFupijyWsyxE80X6MTK5TpfakgGQqduR
 JhdpbiN+UKuiHR2731L+NujiwO4u7PBryO8ylCXU3RzkB/BZJZ5vgv8mCzu16icEjB
 CUVBAOyKQ8P+7hqFwbewwhvoR5tzycCdwA22wzOMZ+9+q6QBBIh/uWEEw5PdZu2Vwm
 BVrjoUTKpZE5+b+CsD92gI40KrO7FShhhXie3LlcQv9GgKlMzWGYhm2mpbvBd7vINv
 ExZrCgW2PIKWmXZyTpLQxv2j6KNEfGazDQu5meUajJaPg23dk/aGvNmFXFSXRbXoC6
 SNESr4WsbemTg==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id 2vqK3a5QBNk2; Tue, 11 Feb 2025 16:44:21 -0800 (PST)
Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id E1C9A3C011BC5;
 Tue, 11 Feb 2025 16:44:21 -0800 (PST)
Message-ID: <a10d8686-72fa-427a-a2c6-1c1331d887c3@HIDDEN>
Date: Tue, 11 Feb 2025 16:44:21 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#74869: Fwd: [PATCH] Add predicates for decoded times and time
 deltas
To: Stefan Kangas <stefankangas@HIDDEN>
References: <e6537a9d-3f74-46a0-9bbd-ef63d045f4c2@HIDDEN>
 <7be82ecf-0d4f-488a-94ae-3f39fe886edb@HIDDEN>
 <CADwFkmmZgoQicu+p9+SsRchsupiRDRhkMNPjtrxPjr_npfpt6w@HIDDEN>
Content-Language: en-US
From: Paul Eggert <eggert@HIDDEN>
Autocrypt: addr=eggert@HIDDEN; keydata=
 xsFNBEyAcmQBEADAAyH2xoTu7ppG5D3a8FMZEon74dCvc4+q1XA2J2tBy2pwaTqfhpxxdGA9
 Jj50UJ3PD4bSUEgN8tLZ0san47l5XTAFLi2456ciSl5m8sKaHlGdt9XmAAtmXqeZVIYX/UFS
 96fDzf4xhEmm/y7LbYEPQdUdxu47xA5KhTYp5bltF3WYDz1Ygd7gx07Auwp7iw7eNvnoDTAl
 KAl8KYDZzbDNCQGEbpY3efZIvPdeI+FWQN4W+kghy+P6au6PrIIhYraeua7XDdb2LS1en3Ss
 mE3QjqfRqI/A2ue8JMwsvXe/WK38Ezs6x74iTaqI3AFH6ilAhDqpMnd/msSESNFt76DiO1ZK
 QMr9amVPknjfPmJISqdhgB1DlEdw34sROf6V8mZw0xfqT6PKE46LcFefzs0kbg4GORf8vjG2
 Sf1tk5eU8MBiyN/bZ03bKNjNYMpODDQQwuP84kYLkX2wBxxMAhBxwbDVZudzxDZJ1C2VXujC
 OJVxq2kljBM9ETYuUGqd75AW2LXrLw6+MuIsHFAYAgRr7+KcwDgBAfwhPBYX34nSSiHlmLC+
 KaHLeCLF5ZI2vKm3HEeCTtlOg7xZEONgwzL+fdKo+D6SoC8RRxJKs8a3sVfI4t6CnrQzvJbB
 n6gxdgCu5i29J1QCYrCYvql2UyFPAK+do99/1jOXT4m2836j1wARAQABzSBQYXVsIEVnZ2Vy
 dCA8ZWdnZXJ0QGNzLnVjbGEuZWR1PsLBlQQTAQgAPwIbAwYLCQgHAwIGFQgCCQoLBBYCAwEC
 HgECF4AWIQR+N5Kp2Kz31jO8FYjtl+kOYqp+NAUCZiLOewUJHWQLDAAKCRDtl+kOYqp+NHGE
 D/9Wmbk+cAaQsYLPGBvyzIjZIRzo/V2p3ZwckVA1VEQivx5azu1cs86qDoVIe45AtwmKOvdV
 wTQd/QeglkZR6D2YPW7UR/7emajyJZZcy+etVTDKoaw1i6/hmd/CpGjUeUSvgoPs6nYR+1lo
 pSXTpaGrh1W0qQHalSkOOwCHG3HtGk9Ve2AERDUYxmcn8/eZHb7xpUJEJMBBI1bx/zcw1EtB
 rjsQ1R1faJ/r/7LPAyV36RLvnbX69PylHKQEbJoaY9aUb2Vpm63ni3FeTA7/3jpPvaSRWHJh
 vPYx6Fm2Ln8pI0Yf/W2B8QMiPTnF/LnH2kvUcf9VXm+1mQJ3fBFU25HZwBhuqZ24IeKymPEt
 BUMQAum97Dto0jSgR2OUvX7z+twhpQEgRGBzPHYwDi4SxF5Z4Q5Y7B7a++HP9tIxG6CVFIwI
 4xVaZud18bPa0YBL+cISmMgxq7h7yoVXl6u3pm9Yiv+W6Lp9QGN8Rw1VuJMOoFCYuoxG8mXO
 TA5b1jvlQ32gHFFhqErDAhNJRsfgrpe9Gok4Ycp+rWljbvS5Wrl0uth5MP7FbaHN2kmTZibq
 KXAd//IqczhDyU6qnW6ao+h4iDBDgYgRbQjmToX/vmIdEMzvPGqWXKhe/q1TYMuOO+IfP+bI
 fyPFH29nVN/o9c4J7myeKvv3HKSXdSVjlh2V787BTQRMgHJkARAApoXrvxP3DIfjCNOtXU/P
 dwMShKdX/RlSs5PfunV1wbKP8herXHrvQdFVqECaTSxmlhzbk8X0PkY9gcVaU2O49T3qsOd1
 cHeF52YFGEt0LhsBeMjgNX5uZ1V76r8gyeVlFpWWb0SIwJUBHrDXexF67upeRb2vdHBjYDNe
 ySn+0B7gFEqvVmZu+LadudDp6kQLjatFvHQHUSGNshBnkkcaTbiI9Pst0GCc2aiznBiPPA2W
 QxAPlPRh3OGTsn5THADmbjqY6FEMLasVX8DSCblMvLwNeO/8SxziBidhqLpJCqdQRWHku5Xx
 gIkGeKOz5OLDvXHWJyafrEYjjkS6Ak6B5z6svKliClWnjHQcjlPzyoFFgKTEfcqDxCj4RY0D
 0DgtFD0NfyeOidrSB/SzTe2hwryQE3rpSiqo+0cGdzh4yAHKYJ+UrXZ4p93ZhjGfKD1xlrNY
 DlWyW9PGmbvqFuDmiIAQf9WD/wzEfICc+F+uDDI+uYkRxUFp92ykmdhDEFg1yjYsU8iGU69a
 Hyvhq36z4zctvbqhRNzOWB1bVJ/dIMDvsExGcXQVDIT7sDNXv0wE3jKSKpp7NDG1oXUXL+2+
 SF99Kjy753AbQSAmH617fyBNwhJWvQYg+mUvPpiGOtses9EXUI3lS4v0MEaPG43flEs1UR+1
 rpFQWVHo1y1OO+sAEQEAAcLBfAQYAQgAJgIbDBYhBH43kqnYrPfWM7wViO2X6Q5iqn40BQJm
 Is58BQkdZAsMAAoJEO2X6Q5iqn40Q68QAJ9GubS/ej30Vc4idoZdc0IyMcL7kQJbMohF+Tyn
 ZE+TGn9WvzP10yLyzoI0vNlcNfP92d2MS//pFjOuANb5mwyiEYA+rDZIdS4ZZpHxCs2sxMC4
 afLCf3kv4aMnTeBvb9na403dlczz9cAacvsmniSFdpb1+BzMpYbybglU5oYMGhYT2nnCRjXN
 6S2nKYt4mjJeeOuxHrdeqQQdVBNYeNfTcPePeqvZ2+bD6u9yxZtaV+wxdpqglosQvjqhOYz7
 h50/ZTSq70/npoCq44TzdJKttaYvlW6ziRz0g4RRAqZyoxjYXiy5qj8r8zXJuB11ApZCGuKn
 /usbji9RYbflAhxFeh4LMmpDVi6BrF30b73Md59K7PuEKN1NxzlWiqqQHZZ9momN0GXLPcGq
 4uyfq7yVEy7wP5PMOh6oqscKklE3gFQtq0P1Ki0xqdF6Fq5LPJc+0Db2CYkVIy7Xaa/f74I3
 sOfQfEeDylVXR5iDfUJEYv/0DYhOr7q5/0b1kh3M4wkrB4C5jVNHjIIj+RsAK90c3t38OhAl
 jiSN7Bkwy24Afy8eIu6wWzvhnsQGpZPB+IffmxT1wkTy8UxZKjUWV0C82iphVgCUUi2f9sDV
 Q/tNcwVWmOS+gdv9Wk6tdGeM+Ee+Qs6YG05jcSoajzF0TL07ajLcayRq2j1Os2CtQ8qu
Organization: UCLA Computer Science Department
In-Reply-To: <CADwFkmmZgoQicu+p9+SsRchsupiRDRhkMNPjtrxPjr_npfpt6w@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74869
Cc: 74869 <at> debbugs.gnu.org, Richard Lawrence <rwl@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: -1.0 (-)

On 2/11/25 11:14, Stefan Kangas wrote:

> Does that mean to imply that this bug is a wontfix?

Given rwl's December 29 message 
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74869#16> it sounds like 
it might be better to have something like an icalendar-decoded-time-p 
function, which follows the iCalendar standard as opposed to Emacs's 
more-idiosyncratic rules. So, not a wontfix; more a "let's keep this in 
iCalendar for now".




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

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


Received: (at 74869) by debbugs.gnu.org; 11 Feb 2025 19:14:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 11 14:14:14 2025
Received: from localhost ([127.0.0.1]:58637 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1thvi2-00037a-B4
	for submit <at> debbugs.gnu.org; Tue, 11 Feb 2025 14:14:14 -0500
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:43372)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1thvi0-000378-NE
 for 74869 <at> debbugs.gnu.org; Tue, 11 Feb 2025 14:14:13 -0500
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5de6069ceb5so109268a12.1
 for <74869 <at> debbugs.gnu.org>; Tue, 11 Feb 2025 11:14:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1739301246; x=1739906046; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=PuzKtGXZ+6LVCsajMGvaHbi72tEkFgXq5ezbUHVtJCM=;
 b=ZH0QIZBmqkbZQ7nQU/MGUzbEybrNVh1wgICm1hjL51KtOvSYijUgwg94kZd9xAZ/qp
 LM9X7L05qfjZshvh0QnakWbOLSD/J0bj2Snov/tF9hg0ObaPndaVUp+wa9BnJXryzWEY
 Q8ixoXZGsXwLGaKjvW3sOUKqRjMXggAfQ0hz47hxzIdxakD7tt9AXrdm8RuISIddnuvW
 DfLVFR7f+Vmnfz5mH9NM3Nn133yNMM/4pNHyQHPGMWLhsBIKkjIq2AqUobJO++5V4OJf
 ZAazo+3K7vGix5KsakObrOdqlop8IZDPV/R+zRpCD00tHa4yhpSK9hsNooVFeaNQyPhy
 eq7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1739301246; x=1739906046;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=PuzKtGXZ+6LVCsajMGvaHbi72tEkFgXq5ezbUHVtJCM=;
 b=beuu+B7Z8DYquyRU4NSloUIf5vtCphItoQHP1UlI2sZvVRYtQ4EmD4RXy1Fly+x1vJ
 crlcIYkEJlpymYaTuy/0HLXbL8w8CZZFMS6joyBzHLJyqxt5ghHppQaJ7q4/T8lmGyPb
 E8GriRtU9zMOltFVVNtQJHTAzE8XCpXGNarVqmgf0Qs50gb7xtNPee4tV2Ue5hgkd3kJ
 G1qPaYsdIOvRq87FrthXfuny10FDjnpWVnjC3Tuho4ZaJAUgLQWHe/NDajeWhkCs395z
 ToGV2zHve52YxxceMCBPpkU3m5E0J+R6sg+IOZ0EcTkHXvxLISrDAgsJrHukftglLlhR
 9jCw==
X-Gm-Message-State: AOJu0Yyg6lWKn3MA5KAWmBMIconwuHTSGHTS4qT3tkE0tedCXKFnNXS1
 HEzTC2jAVZ0/BGIb8irKFNHb9hRaqsUO0I0sK7B38KlQF6pvGKgIeMWPHe0g2REL0RosKcjo6HN
 oy0VQWbdUNDOwSjOKjWzwLI61EzM=
X-Gm-Gg: ASbGncvQrwZj8bKeSG8D5UE0jSwBRrEpDHm/IkYLc/GBcT02gQQgdlk+m09jMONKVPP
 lYTnJpeyN7r73WKeBUg2X6AE0EgsbwPzZERFi28o1vbW23pFgXWENZNiHRmZC59Kc0cKY4KxJkw
 ==
X-Google-Smtp-Source: AGHT+IEhmqT2KzzheMj4X1Lr40NuYvTsgEwOlK7XTK/kWAiYHR7eFMZ79+L5T43gI6cQLvvQFDcdXCCEIimOBz8lxPw=
X-Received: by 2002:a05:6402:3591:b0:5de:5cb3:e82a with SMTP id
 4fb4d7f45d1cf-5de9b6f8cebmr4085711a12.0.1739301246133; Tue, 11 Feb 2025
 11:14:06 -0800 (PST)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 11 Feb 2025 11:14:05 -0800
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <7be82ecf-0d4f-488a-94ae-3f39fe886edb@HIDDEN>
References: <e6537a9d-3f74-46a0-9bbd-ef63d045f4c2@HIDDEN>
 <7be82ecf-0d4f-488a-94ae-3f39fe886edb@HIDDEN>
MIME-Version: 1.0
Date: Tue, 11 Feb 2025 11:14:05 -0800
X-Gm-Features: AWEUYZniTULmieUB7k0m16AYOOWB4Yr7J7MPhAVhASOcETSQOkldQ8fZ2CMaKAw
Message-ID: <CADwFkmmZgoQicu+p9+SsRchsupiRDRhkMNPjtrxPjr_npfpt6w@HIDDEN>
Subject: Re: bug#74869: Fwd: [PATCH] Add predicates for decoded times and time
 deltas
To: Paul Eggert <eggert@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74869
Cc: 74869 <at> debbugs.gnu.org, Richard Lawrence <rwl@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: -1.0 (-)

Paul Eggert <eggert@HIDDEN> writes:

> Forwarding another mis-addressed email of mine.
>
>
> -------- Forwarded Message --------
> Subject: Re: [PATCH] Add predicates for decoded times and time deltas
> Date: Sat, 28 Dec 2024 09:26:23 -0800
> From: Paul Eggert <eggert@HIDDEN>
> To: Richard Lawrence <rwl@HIDDEN>
> CC: 74689 <at> debbugs.gnu.org
>
> On 12/28/24 07:56, Richard Lawrence wrote:
>> I need to use
>> `calendar-extract-month' with a plain date value, but
>> `decoded-time-month' with a date-time value. I need type predicates to
>> do such dispatching.
>
> Not necessarily; you can instead try each function in turn and use the first
> that works.
>
> I have some qualms about saying that decoded times are a "type". Whether a
> decoded time is valid depends on the timezone: (0 30 2 10 3 2024 0 t -21600) is
> a valid decoded time in Phoenix but not in Denver, because clocks sprang forward
> over that time in Denver but not in Phoenix. When data interpretation gets that
> complicated, the Emacs notion of "type" is not always the best.

Does that mean to imply that this bug is a wontfix?




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

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


Received: (at 74869) by debbugs.gnu.org; 5 Jan 2025 08:45:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 05 03:45:29 2025
Received: from localhost ([127.0.0.1]:59796 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tUMGG-00051X-KV
	for submit <at> debbugs.gnu.org; Sun, 05 Jan 2025 03:45:29 -0500
Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]:53039)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <rwl@HIDDEN>)
 id 1tUMGD-00051D-Cz
 for 74869 <at> debbugs.gnu.org; Sun, 05 Jan 2025 03:45:26 -0500
Received: from phl-compute-05.internal (phl-compute-05.phl.internal
 [10.202.2.45])
 by mailfout.stl.internal (Postfix) with ESMTP id AE9E01140137
 for <74869 <at> debbugs.gnu.org>; Sun,  5 Jan 2025 03:45:19 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-05.internal (MEProxy); Sun, 05 Jan 2025 03:45:19 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 recursewithless.net; h=cc:content-type:content-type:date:date
 :from:from:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to; s=fm1; t=1736066719; x=
 1736153119; bh=SxaweHZBPl3DqSSJehxpANLk0Gj/5HfBVxto3GNXy6Y=; b=n
 r4XJGcJpPtxilQG7Xb2C7q2YvJ8dCxI7Zrs3W3DHoJAjNHrGs86vh/li/xZSii0b
 k6DeCKELv1BrermWIsZYTYwTV9CoIXeG9Uvx0fCjQDCXMq+bmWhVp8tlItBELsy4
 oPL0svwXE+R/GfcfWvv+LEoWrJ4aHXz0+NOVY8GFBMNCQlXhk0ApzEc/80TRZWDT
 DkXsnfkY+X+w1kwVDMC0RyYW1Qg+maESqQyfbK/3vrXvJis8Ge0PYBe9bJSN0HMJ
 jmktLl22mWqpJAJGHfZN9O6I7ChCpMDHAVc1WYdCqxDPMg0bfVEaHFyUUZpapwid
 +AIRb8sUJZ45PJqv3haTg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:message-id
 :mime-version:references:reply-to:subject:subject:to:to
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=
 1736066719; x=1736153119; bh=SxaweHZBPl3DqSSJehxpANLk0Gj/5HfBVxt
 o3GNXy6Y=; b=gZthcPgfID6b6qYmzR149JigiB8LbSS4d8PjziMpu54v4bNHuF4
 Ps6kXzLzRKs9Mnae3353NzTFfbndWQazywORnNujDl/MiEclUHLFAuvKz6EsF1oq
 XXowMwEdi0lHwgHXvTH8vg/NPsG0eBC95ZUp7/gyLyVzMD8z1b/F3B6xYzxT6QvP
 PBp3OjtpMoy5WGOmcDE/YoXIMR5sUQEfHSRhFpws2OSmaQSLphAjdbAcqawJLvoY
 u2CKl7JFTnjd1AgqwWaiv7fGlo8EPu07Kifvnsev1H/ZkFVE8gSvm3vtNQqkc5Yr
 R5XmIBr2ETip6FjfYhTNO3FKcoiSJOXc2rw==
X-ME-Sender: <xms:n0Z6Z8PhISqM9ntLLLrjhFh7VEfyiRHJWFlIVCAHHHzXD4g5YrziYw>
 <xme:n0Z6Zy9u_OKmfS-P9aLga6U_wFEp7xE-eaiNJP4Zdv6YByKYumsOT83XlOHz1JSwV
 LXlQGG0mvRwiyIamg>
X-ME-Received: <xmr:n0Z6ZzR8Lb3JseMJIATXPBWEaVuvo4S_xBTwW6qvqXj583vmmsvVWXcB>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefjedguddvhecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp
 uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvuf
 hffffkgggtsehttdertddttddtnecuhfhrohhmpeftihgthhgrrhguucfnrgifrhgvnhgt
 vgcuoehrfihlsehrvggtuhhrshgvfihithhhlhgvshhsrdhnvghtqeenucggtffrrghtth
 gvrhhnpedvvefgtdetudejkeegjeelhfdvteegjedvheehueffheetkeejuedtuddukeej
 keenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrfi
 hlsehrvggtuhhrshgvfihithhhlhgvshhsrdhnvghtpdhnsggprhgtphhtthhopedupdhm
 ohguvgepshhmthhpohhuthdprhgtphhtthhopeejgeekieelseguvggssghughhsrdhgnh
 hurdhorhhg
X-ME-Proxy: <xmx:n0Z6Z0sGyEbtR6hB4U1XpvRGr0qBQQvqrzrQilwC8YFFWDHPTfW8Ow>
 <xmx:n0Z6Z0fUOeyyWaAY3_xK-i_rK6EDdu-5AeYoFk4tnmNPHVqvbAT2bw>
 <xmx:n0Z6Z43IsU2dew1xOEG0KYSORdqg9sScl8aD9kDnlLqlf44A0Cmk8g>
 <xmx:n0Z6Z4-jemloaNWfvPyLfHvv6L7RZp8I3r0rgZtDfPZZ9BARrEWqEg>
 <xmx:n0Z6ZwFw3_RNWVPjuRP7Jw7me5Am3m6H92cU4ezxH_N0EeANUQMLJAj5>
Feedback-ID: if7394488:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <74869 <at> debbugs.gnu.org>; Sun, 5 Jan 2025 03:45:18 -0500 (EST)
From: Richard Lawrence <rwl@HIDDEN>
To: 74869 <at> debbugs.gnu.org
Subject: Re: [PATCH] Add predicates for decoded times and time deltas
References: <87zfkeud74.fsf@HIDDEN>
Date: Sun, 05 Jan 2025 09:45:10 +0100
Message-ID: <878qrp8x9l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74869
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.7 (-)

I'm also forwarding a mis-addressed email back to the relevant bug list

-------------------- Start of forwarded message --------------------
From: Richard Lawrence <rwl@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: [PATCH] Add predicates for decoded times and time deltas
Date: Sun, 29 Dec 2024 09:05:03 +0100

Paul Eggert <eggert@HIDDEN> writes:

> On 12/28/24 07:56, Richard Lawrence wrote:
>> I need to use
>> `calendar-extract-month' with a plain date value, but
>> `decoded-time-month' with a date-time value. I need type predicates to
>> do such dispatching.
>
> Not necessarily; you can instead try each function in turn and use the 
> first that works.

Well, in this case, they'll both "work" but can return incorrect values:
`calendar-extract-month' is just implemented as `car', so if I call it
on a decoded time, I'll get the seconds slot value rather than the month
slot value. Similarly, `decoded-time-second' will return the month if
called on a calendar date. 

If both calendar dates and decoded times were implemented as
records/cl-structs, rather than plain lists, then these accessor
functions could signal an error if passed a value of the wrong type. But
they aren't, and that doesn't seem likely to change anytime soon, so
having a predicate seems important.

> I have some qualms about saying that decoded times are a "type". Whether 
> a decoded time is valid depends on the timezone: (0 30 2 10 3 2024 0 t 
> -21600) is a valid decoded time in Phoenix but not in Denver, because 
> clocks sprang forward over that time in Denver but not in Phoenix. When 
> data interpretation gets that complicated, the Emacs notion of "type" is 
> not always the best.

I see. Would it help to change the name, or add some documentation, to
make it clear that the predicate doesn't (can't?) test for cases like
this? What about calling it something like `decoded-time-like-p' or
`maybe-decoded-time-p'? 

The iCalendar standard sets clear limits on the slot values, but these
aren't fine grained enough to rule out cases like the one you gave. All
it says is basically:

a date-time consists of a year, month, month-day, hour, minute, second,
  and (possibly) a UTC offset
a year is a four digit (positive) integer
a month is in the range 1-12
a month-day is in the range 1-28, 1-29, 1-30, or 1-31, depending on the
  month and year
an hour is in the range 0-23
a minute is in the range 0-59
a second is in the range 0-60 (60 represents a leap second)
a UTC offset is a sign together with an hour, minute, and second,
  where the second cannot be 60

So that's what the iCalendar code needs to check for. If it would be
better to keep this predicate in the iCalendar code, I can certainly do
that. I thought it would be more generally useful and should therefore
go with the existing code for decoded times, but maybe I was wrong about
that.

Best,
Richard
-------------------- End of forwarded message --------------------




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74869; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 74869) by debbugs.gnu.org; 29 Dec 2024 19:18:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 29 14:18:40 2024
Received: from localhost ([127.0.0.1]:56248 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tRyoC-0000Lf-Jl
	for submit <at> debbugs.gnu.org; Sun, 29 Dec 2024 14:18:40 -0500
Received: from mail.cs.ucla.edu ([131.179.128.66]:49528)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1tRyoB-0000LR-1h
 for 74869 <at> debbugs.gnu.org; Sun, 29 Dec 2024 14:18:39 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id BEF063C005176;
 Sun, 29 Dec 2024 11:18:33 -0800 (PST)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id 5bNG9tZDcn60; Sun, 29 Dec 2024 11:18:33 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 7F0713C026D7F;
 Sun, 29 Dec 2024 11:18:33 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 7F0713C026D7F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1735499913;
 bh=B5R95gHqVc7v7fMCAiXl/YAbhUp0CNGVHEr6iwp39pQ=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=IwMbi9xK0bha5xcNoIGDHEZN4rfe+ataZDrWGUkNnCWxKKVIjF90qSWulM/UDm++O
 B4K9UOIr6ZOGHNGZoAsQDyo40iMcbLmX/+/EwMdU3eDuwXJ+U6n66g55sjOBhE9d5c
 ma1JMqtz/nxCeydPnN0MLmu9p+RGR6Our1TT65VBhZ73CbCNUimOs0YIORCXZTJirq
 /bDmwEKTcOj/NLcco24kopq/mvtr+M3zpsEF81OXE9jLQXY/Gdv60052wZsJlWjLxH
 Nc5nxwB9vFGx+wpeF4b2XxtXF5H00XpEAuRkVRfkbrJqir5KFrikvwy8XBRwt+yc2j
 bDTycyKAYpQCQ==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id opntULYYUG9F; Sun, 29 Dec 2024 11:18:33 -0800 (PST)
Received: from [192.168.0.102] (unknown [47.154.28.214])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id 577A63C005176;
 Sun, 29 Dec 2024 11:18:33 -0800 (PST)
Message-ID: <7be82ecf-0d4f-488a-94ae-3f39fe886edb@HIDDEN>
Date: Sun, 29 Dec 2024 11:18:33 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Fwd: [PATCH] Add predicates for decoded times and time deltas
Content-Language: en-US
References: <e6537a9d-3f74-46a0-9bbd-ef63d045f4c2@HIDDEN>
To: 74869 <at> debbugs.gnu.org
From: Paul Eggert <eggert@HIDDEN>
In-Reply-To: <e6537a9d-3f74-46a0-9bbd-ef63d045f4c2@HIDDEN>
X-Forwarded-Message-Id: <e6537a9d-3f74-46a0-9bbd-ef63d045f4c2@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74869
Cc: Richard Lawrence <rwl@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: -1.0 (-)

Forwarding another mis-addressed email of mine.


-------- Forwarded Message --------
Subject: Re: [PATCH] Add predicates for decoded times and time deltas
Date: Sat, 28 Dec 2024 09:26:23 -0800
From: Paul Eggert <eggert@HIDDEN>
To: Richard Lawrence <rwl@HIDDEN>
CC: 74689 <at> debbugs.gnu.org

On 12/28/24 07:56, Richard Lawrence wrote:
> I need to use
> `calendar-extract-month' with a plain date value, but
> `decoded-time-month' with a date-time value. I need type predicates to
> do such dispatching.

Not necessarily; you can instead try each function in turn and use the 
first that works.

I have some qualms about saying that decoded times are a "type". Whether 
a decoded time is valid depends on the timezone: (0 30 2 10 3 2024 0 t 
-21600) is a valid decoded time in Phoenix but not in Denver, because 
clocks sprang forward over that time in Denver but not in Phoenix. When 
data interpretation gets that complicated, the Emacs notion of "type" is 
not always the best.




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

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


Received: (at 74869) by debbugs.gnu.org; 29 Dec 2024 19:17:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 29 14:17:42 2024
Received: from localhost ([127.0.0.1]:56243 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tRynG-0000Ja-0v
	for submit <at> debbugs.gnu.org; Sun, 29 Dec 2024 14:17:42 -0500
Received: from mail.cs.ucla.edu ([131.179.128.66]:36566)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1tRynD-0000JM-IV
 for 74869 <at> debbugs.gnu.org; Sun, 29 Dec 2024 14:17:40 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id ACB273C005176;
 Sun, 29 Dec 2024 11:17:33 -0800 (PST)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id dXGwSv5v2gdr; Sun, 29 Dec 2024 11:17:33 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 6D6163C026D7F;
 Sun, 29 Dec 2024 11:17:33 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 6D6163C026D7F
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1735499853;
 bh=tODPg2ZyJOlNV1XrD4JZLmhf14qiK5xx3LN1nxawWdI=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=dctg3TevMlMNQ/KPmR9jF2Sh6G/mjZDGeZGXGlS/ul1upKdvVr3GaX+mU6LxRlv/I
 v/KMxOuulYEsklERY74hlPdjxd8Aai+s4DsQ0Pz/EhicBb0xc8gTbI2YD5mmg9QqcK
 K3Qax7hErNomfnfKw5KlllO3iNuk0c8bBT76OTQRdPTC8LDEwfHg8U/GcQqu2Vnp7+
 99vsdiPr5IeXfuV8OUKSGEGLxtuyfL1O0BAWIWrmFQ+CuBBvRN80hNLJ/RBaWKUStd
 PgOoiCEZwa3RcPzHWkoRFrSiyoMl+wTqtYBpfJrUzv8YH5nWIuW6sa34biTQE46USI
 NItwQiyn3gVQQ==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id IsDTkpkmm0nL; Sun, 29 Dec 2024 11:17:33 -0800 (PST)
Received: from [192.168.0.102] (unknown [47.154.28.214])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id 495A33C005176;
 Sun, 29 Dec 2024 11:17:33 -0800 (PST)
Message-ID: <ed162bc7-c624-4ce9-94b3-0f6492f5a421@HIDDEN>
Date: Sun, 29 Dec 2024 11:17:33 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Fwd: [PATCH] Add predicates for decoded times and time deltas
Content-Language: en-US
References: <468ca0ab-a4aa-41ed-8f6c-260940f3f9f3@HIDDEN>
To: 74869 <at> debbugs.gnu.org
From: Paul Eggert <eggert@HIDDEN>
In-Reply-To: <468ca0ab-a4aa-41ed-8f6c-260940f3f9f3@HIDDEN>
X-Forwarded-Message-Id: <468ca0ab-a4aa-41ed-8f6c-260940f3f9f3@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74869
Cc: Richard Lawrence <rwl@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: -1.0 (-)

Argh, I now see that I cc'ed the wrong bug report. It should be bug 
74869, not 74689. Forwarding this two-day-old email to the correct bug 
report. Sorry about the duplication.


-------- Forwarded Message --------
Subject: Re: [PATCH] Add predicates for decoded times and time deltas
Date: Fri, 27 Dec 2024 16:44:32 -0800
From: Paul Eggert <eggert@HIDDEN>
To: Richard Lawrence <rwl@HIDDEN>
CC: 74689 <at> debbugs.gnu.org

What's the use case for these proposed predicates? I'm finding it hard 
to review the patch without knowing what it's for.

Surely this should be in time-date.el rather than simple.el.

The implementation of decoded-time-p seems complicated and doesn't match 
what decode-time produces. Wouldn't it be simpler to call (ignore-errors 
(equal val (decode-time (encode-time val))))?




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

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


Received: (at submit) by debbugs.gnu.org; 14 Dec 2024 16:12:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 14 11:12:11 2024
Received: from localhost ([127.0.0.1]:48105 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tMUkR-0001UD-4M
	for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 11:12:11 -0500
Received: from lists.gnu.org ([209.51.188.17]:46848)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rwl@HIDDEN>) id 1tMUkJ-0001Sp-L7
 for submit <at> debbugs.gnu.org; Sat, 14 Dec 2024 11:12:05 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rwl@HIDDEN>)
 id 1tMUkI-0003ds-DH
 for bug-gnu-emacs@HIDDEN; Sat, 14 Dec 2024 11:11:58 -0500
Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rwl@HIDDEN>)
 id 1tMUkC-0004Gi-R3
 for bug-gnu-emacs@HIDDEN; Sat, 14 Dec 2024 11:11:58 -0500
Received: from phl-compute-12.internal (phl-compute-12.phl.internal
 [10.202.2.52])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 720F5254015C
 for <bug-gnu-emacs@HIDDEN>; Sat, 14 Dec 2024 11:11:49 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-12.internal (MEProxy); Sat, 14 Dec 2024 11:11:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 recursewithless.net; h=cc:content-type:content-type:date:date
 :from:from:in-reply-to:message-id:mime-version:reply-to:subject
 :subject:to:to; s=fm3; t=1734192709; x=1734279109; bh=bkSRXg7vAx
 15DGOInaColTSdYxNHbqnH93FhfYvl/PM=; b=u33mnkg1+CtnLK/SkXCY3KXFV/
 DpcCRHOnx5zupPZe1pU5Y5nVNs6FO8gYOUmwEl5zGnvrGH89MCc7ul5FsIaQ23kh
 bc9gBiL9H2699c1JbcZimfc9UryB6QouD7mGcBVaP5LW7kLbdT3BbHRZLzJQqx4P
 xCr8vZ58YJaUltsdaTInzbRLemtLzI/5S8RMluJBXPW7tzCB5IeWeZCG+MLRha7m
 AOmdVuLKhUJn53eRtAzEThuwvqpKjYmcJwUuptrmqEUgkcWUyLKDhmCzPLQphe82
 F8AQ9yX/xcEbjWtEbhsz6ol0uWEur/Y7cAS/qYQxROgwqg1uobEb3aTZquGg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:message-id
 :mime-version:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734192709; x=
 1734279109; bh=bkSRXg7vAx15DGOInaColTSdYxNHbqnH93FhfYvl/PM=; b=Z
 RyN54u8+x9mhSWJL3RCpJUdy3y+A4GdiUWVKligRzx4LkAXdwZqyfyzkXIiWHGnH
 TtWRDVhGPVlSwRNOKG0a0A3Pj7wnEOB4/1MWqbbGv0rl6ECAjHGneZ0TkOfI96PZ
 zfa3JR80TtoP4h9SpJYudioPUGeBOlOExQj9kztetm5B1hcKit7yJCvIqlNiMgvT
 MRxqWEmACeJSperMEtAHn0RX3LQCG2eLAMkmd4wKaGMycP7wAWgWJfSBJ+X17H/R
 AfJ0yYaik97wWFhFHWplXILOMB/n38e2StXthMIwfHLSOD3XCYpZdYNrTlN4MRkp
 dtN7IDUSqwkkTIrUJvzOA==
X-ME-Sender: <xms:Ra5dZ1TF6SQhr6W_BcS_E6BF-3JoMl1-YonSlhEYywj01jZKyFFIYQ>
 <xme:Ra5dZ-yYOMi7aWLChVKDqRg6xmzlb0J0QrDIgrykMvoB_uktXI9PapdcSbdh2vgUM
 uOKiFZBg3MAopEkNQ>
X-ME-Received: <xmr:Ra5dZ618bbItYuzvmB8EW8ydOUBShk2cLbqcYILezhVXw86UCY25mxCvEg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeelgdekfecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr
 tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkf
 ggtgesmhdtreertddttdenucfhrhhomheptfhitghhrghrugcunfgrfihrvghntggvuceo
 rhiflhesrhgvtghurhhsvgifihhthhhlvghsshdrnhgvtheqnecuggftrfgrthhtvghrnh
 epieduleffheekhfeihfetgeekveelieetvefhteeggefgudevueejveeghfekleelnecu
 vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhiflhesrh
 gvtghurhhsvgifihhthhhlvghsshdrnhgvthdpnhgspghrtghpthhtohepuddpmhhouggv
 pehsmhhtphhouhhtpdhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdroh
 hrgh
X-ME-Proxy: <xmx:Ra5dZ9DvAJGEz_fREkYLdHDSMXWZF3VQpYpFXzFoYrKDPLRcvKeReg>
 <xmx:Ra5dZ-i_3kTY4iGxSoP_Bx79bilDwL9num-IVIcHs87Hjc45C-G46w>
 <xmx:Ra5dZxrCCA6CySFUmVe4_0X1hNDwrC9jeHcY8HQbkaGZR-hpLSvZiA>
 <xmx:Ra5dZ5iSs8bUpPOMKJG5BngEueIDb7HR0FB2H46iriPpjmVwTaf4aA>
 <xmx:Ra5dZyYleDoimpdl4XLtHUq4fZlkOJ7dYD7Dj2W8FGWYOv65T6QnvG6J>
Feedback-ID: if7394488:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <bug-gnu-emacs@HIDDEN>; Sat, 14 Dec 2024 11:11:48 -0500 (EST)
From: Richard Lawrence <rwl@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Add predicates for decoded times and time deltas
Date: Sat, 14 Dec 2024 17:11:41 +0100
Message-ID: <8734iqp7lu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=202.12.124.152;
 envelope-from=rwl@HIDDEN; helo=fhigh-b1-smtp.messagingengine.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_PASS=-0.001,
 T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
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.6 (--)

--=-=-=
Content-Type: text/plain

Tags: patch

This is a rough draft of a patch to add two new predicates related to
decoded times: `decoded-time-p', which checks that a value is a decoded
time (as documented in `decode-time'), and
`decoded-time-delta-p', which checks that a value is a time delta (as
documented in `decoded-time-add').

Some questions:

1) Should these functions go in simple.el? I put them there because that
is where the structure definition for decoded-time is. (The definition
does not generate a predicate automatically because it uses :type but
not :named; see Info node `(cl)Structures'.) But at least
`decoded-time-delta-p' might be better off in time-date.el, which is
where `decoded-time-add' is defined.

2) Should `decoded-time-p' also check the weekday slot of decoded times?
See the FIXME comment in the middle of the function: `make-decoded-time'
neither sets this slot nor provides an argument to let the caller set
it. This is apparently intentional: there is a comment in the
definition of `make-decoded-time',

  ;; Do not set decoded-time-weekday or decoded-time-dst,
  ;; as encode-time can infer them well enough when unknown.

but if the slot is not meant to be set I don't understand why it's
there. It would be useful, for iCalendar purposes, to have the weekday
slot automatically calculated from the date values when a decoded time
is constructed. I'm not sure if this use was just not envisioned, or if
there was a more substantial reason not to do it in make-decoded-time.

Hopefully I got the commit message right this time, but please let me
know if that needs tweaking too...

Best,
Richard


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Add-predicates-for-decoded-times-and-time-deltas.patch

From a9075f0dc459c1b3b0c3d2e4b7eb33553d7adac9 Mon Sep 17 00:00:00 2001
From: Richard Lawrence <rwl@HIDDEN>
Date: Sat, 14 Dec 2024 16:36:45 +0100
Subject: [PATCH] Add predicates for decoded times and time deltas

* lisp/simple.el (decoded-time-p): Add predicate for decoded
times.
* lisp/simple.el (decoded-time-delta-p): Add predicate for time
deltas.
---
 lisp/simple.el | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/lisp/simple.el b/lisp/simple.el
index f2ee4a5df67..ac06a49402f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -11228,6 +11228,41 @@ capitalize-dwim
 the number of seconds east of Greenwich.")
   )
 
+(defun decoded-time-p (val)
+  "Return non-nil if VAL is a decoded time.
+See `decode-time' for the expected format of VAL."
+  (and (listp val)
+       (length= val 9
+       ;; TODO: according to `decode-time', sec can also be a "Lisp
+       ;; timestamp"...is there a predicate for that?
+       (cl-typep (decoded-time-second val) '(integer 0 60))
+       (cl-typep (decoded-time-minute val) '(integer 0 59))
+       (cl-typep (decoded-time-hour val) '(integer 0 23))
+       (cl-typep (decoded-time-day val) '(integer 1 31))
+       ;; FIXME: the weekday slot value should ideally be automatically
+       ;; calculated from month, day, and year on construction, like:
+       ;;   (calendar-day-of-week (list month day year))
+       ;; `make-decoded-time' does not do this at present, and also has no
+       ;; option to set the weekday slot.
+       ;; (cl-typep (decoded-time-weekday val) '(integer 0 6))
+       (cl-typep (decoded-time-month val) '(integer 1 12))
+       (cl-typep (decoded-time-year val) 'integer)
+       (cl-typep (decoded-time-dst val) '(member t nil -1))
+       (cl-typep (decoded-time-zone val) '(or integer null)))))
+
+(defun decoded-time-delta-p (val)
+  "Return non-nil if VAL is a decoded time delta of the sort required by
+`decoded-time-add'."
+  (and (listp val)
+       (length= val 9)
+       ;; weekday, dst, zone can be ignored
+       (cl-typep (decoded-time-second val) '(or null integer))
+       (cl-typep (decoded-time-minute val) '(or null integer))
+       (cl-typep (decoded-time-hour val) '(or null integer))
+       (cl-typep (decoded-time-day val) '(or null integer))
+       (cl-typep (decoded-time-month val) '(or null integer))
+       (cl-typep (decoded-time-year val) '(or null integer))))
+
 ;; 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.
-- 
2.39.5


--=-=-=--




Acknowledgement sent to Richard Lawrence <rwl@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#74869; 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: Wed, 12 Feb 2025 05:30:02 UTC

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