From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Lawrence Newsgroups: gmane.emacs.devel Subject: [PATCH] Re: Making decoded-times and calendar dates compatible? Date: Mon, 16 Dec 2024 21:05:30 +0100 Message-ID: <87frmno0l1.fsf@recursewithless.net> References: <87seqy5qr8.fsf@ohm.mail-host-address-is-not-set> <8734isrign.fsf@ohm.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29095"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 16 21:06:35 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tNHMP-0007PG-Ep for ged-emacs-devel@m.gmane-mx.org; Mon, 16 Dec 2024 21:06:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNHLg-0006uL-0h; Mon, 16 Dec 2024 15:05:48 -0500 Original-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 ) id 1tNHLc-0006tq-7j for emacs-devel@gnu.org; Mon, 16 Dec 2024 15:05:44 -0500 Original-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 ) id 1tNHLZ-0000w3-PP; Mon, 16 Dec 2024 15:05:43 -0500 Original-Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 6D69C2540147; Mon, 16 Dec 2024 15:05:38 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Mon, 16 Dec 2024 15:05:38 -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=fm3; t=1734379538; x=1734465938; bh=pGrvmwDc5dtuQvVJYmcuQh/YyJb/PnR2gxsKUaZdfjk=; b= q2C5XKhR31JwsLQAhDRa2lIqZeqdRn06IhWTwyrMPExhmXCaYDataEIr5Gj4wavF Nidzf1RVC40HB5Js+sOKGdKvAka1C2AzER6ifl7MV9UeYf/FJXGh3RCTDHNU+Gmk rpKyFeyWyYJC1gN/W3pBugD+M166UUymzeLWuaCOys66jGbI7Zc0beSJc9Z4Y1rG A0r7uZr2KGTxGydFBPau1ZUvhk2nhEF68obBDatqiDRt3KCsmksZt4emtGQKtKlS qNu/61NPBavoRNveT7QxO/pHPuHI1S4cqjE3/dW91Mria4urU5P2qJsYRc7/PDiv 8oKCHmeWwzM4/fOcwf8L6A== 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=fm1; t= 1734379538; x=1734465938; bh=pGrvmwDc5dtuQvVJYmcuQh/YyJb/PnR2gxs KUaZdfjk=; b=nsWduqMVsGtAjn4HG5sRgcsrT73ZX4cS1cGo2xT4gMkbawf0gp+ 7alAibI/ECGJURwESpQBQADpB74USxNmnTpyWopZHnZTq3zj7JL/RBKwJhmYsrwI D6l2Wl8AdkMLnHvbvT9K6QFZAeqFoq2bylHzbLZZsj29QpAR0HXisMBedSum114i bZKawtZahGotmExKqT01upeLh9wf7g+n4pHkBMDuvnAzltfjRu3JXu+wIYhc5Km/ Bq9iAiLdZTnAwRYlNMYuIlBFFb2vtv+DjBaiFJLoDJnRpb5F5LqQVQYQ0fr8JTc9 SQyG5RG0wufkXLccp4SumqWR3FVO2t20WvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrleefgddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf gjfhffkfggtgesmhdtreertddttdenucfhrhhomheptfhitghhrghrugcunfgrfihrvghn tggvuceorhiflhesrhgvtghurhhsvgifihhthhhlvghsshdrnhgvtheqnecuggftrfgrth htvghrnhepfeduteehtdefkeduudeludffheetueegleethefgkefhhffhudegffehhfeh vddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprh iflhesrhgvtghurhhsvgifihhthhhlvghsshdrnhgvthdpnhgspghrtghpthhtohepvddp mhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprhhmshesghhnuhdrohhrghdprhgtph htthhopegvmhgrtghsqdguvghvvghlsehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: if7394488:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Dec 2024 15:05:37 -0500 (EST) In-Reply-To: Received-SPF: pass client-ip=202.12.124.152; envelope-from=rwl@recursewithless.net; helo=fhigh-b1-smtp.messagingengine.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URI_DOTEDU=1.997 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326563 Archived-At: --=-=-= Content-Type: text/plain Richard Stallman writes: > The docstrings of the functions > > > calendar-extract-year > > calendar-extract-month > > calendar-extract-day > > > are where the (MONTH DAY YEAR) format is mentioned. > > Would someoe like to add some comments at the start of the file > documenging this data structure? Attached is a patch which adds such a comment, based on my previous message; let me know if I should open a bug report for this. For now I take it that it's better not to touch the calendar code? I don't think there is any constructor function for dates, or at least, I see that throughout the calendar code, there are many uses of "(list month day year)" to construct dates, so there might be a lot of code to fix if we change the representation, and it might be hard to be sure we've made all the necessary changes. Anyway, this is more work than I want to do at the moment, though I'm willing to take a stab at it eventually if others here think it would be worthwhile. Best, Richard --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Document-representation-of-dates-in-calendar.el.patch >From 4bf17cf59f7f8cc29ca79b03649037416aab1901 Mon Sep 17 00:00:00 2001 From: Richard Lawrence Date: Mon, 16 Dec 2024 20:46:34 +0100 Subject: [PATCH] Document representation of dates in calendar.el * lisp/calendar/calendar.el: Add a comment in file header explaining how dates are represented. --- lisp/calendar/calendar.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 60d8fdd6aee..36d64a2b11c 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -90,6 +90,16 @@ ;; ;; +;; A note on how dates are represented: + +;; The standard format for a (Gregorian) calendar date in this file is a +;; list of integers (MONTH DAY YEAR) -- see the functions +;; `calendar-extract-year', `calendar-extract-month', and +;; `calendar-extract-day'. Internally it also uses an "absolute" format +;; which is an integer number of days since December 31, 1BC (see +;; e.g. `calendar-absolute-from-gregorian'), and converts between +;; different calendar scales by converting to and from the absolute +;; format (see e.g. `calendar-iso-from-absolute' in cal-iso.el). ;; A note on free variables: -- 2.39.5 --=-=-=--