From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6KtaFpfoVmIRngAAgWs5BA (envelope-from ) for ; Wed, 13 Apr 2022 17:13:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UGoFE5foVmLcWQAAauVa8A (envelope-from ) for ; Wed, 13 Apr 2022 17:13:27 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 00FE42E365 for ; Wed, 13 Apr 2022 17:13:26 +0200 (CEST) Received: from localhost ([::1]:57676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neegP-0000j0-JO for larch@yhetil.org; Wed, 13 Apr 2022 11:13:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neefm-0000ib-UG for emacs-orgmode@gnu.org; Wed, 13 Apr 2022 11:12:46 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:44941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neefl-0004jG-2p for emacs-orgmode@gnu.org; Wed, 13 Apr 2022 11:12:46 -0400 Received: by mail-lj1-x235.google.com with SMTP id u19so2565234ljd.11 for ; Wed, 13 Apr 2022 08:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Z0UZsaFSc6s1PGLHJAzWDyQj3Ov04G96vHdXxhtC10k=; b=ICQZ+4qj7S1g+Sk7ZnuW6HwM3T/Pnb1JvzoEJRKKMVJbrlotUiVTorIjHEcQPkCns6 Wj7Xfnkj209jYfJp9j0zp6glkVbWVej/FSnBK4vvoHqq//nE+HPSVf3E3ktHla5p4M70 8DydEdUoZe9S/i/79h3ujDKa4taZo0f5GQQ0dAZAzDbm3z2Xw1trSqpRCD2AxzYFEp+d rsNMRoxKduvNekhue3jH70JN4xz3M6uqPjQu4ahAv0qyT6KtHJf5G1JJQr8H/YAa/gPC H1xLAl55gJkj2noX1SNtd9WH7deqgQqBl3jFE9NKsr8CFH/hKACs9UhPm7TVL19LXbui atpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Z0UZsaFSc6s1PGLHJAzWDyQj3Ov04G96vHdXxhtC10k=; b=ZdyQiBYf11R1VSx51nMX8/QoCLDGpPtk5/TI5JuCgEOQREQWR6PrsFoh0UrA+1nLY1 qZ9K+bsSfiixDj/ilunZXn24UHDMeA4R38Oz3ql7C8aoFh0H269lY+Yf7getVpnbHpEI kfMNDTsw3RR72cUsHN82/jgKYKB7k2KoFh4gGLgh/jZbG5RhPe9VHhDLg2eS25NkGUWr zI+Nwly1LG+k5UDiK5h5CDmX5m8vQxBhtzw15eRe6wP72LiVaGfMpMGrRt5cZY+QqY0i sTAVaSIcwU1C63iojIlH3LzYMKY9bogqp+3ty5XhfHO4KMsKj1+dA6NB7xfx+B+PV/yb 5zBA== X-Gm-Message-State: AOAM532OG2GNvel/Gi1eaEFZ0cVpxe7UOBn3w2TmhaCtbvsgbVGjsUXQ oJbDKe/Eqn9PR+A6GvaeadA= X-Google-Smtp-Source: ABdhPJyy8C9lBW6dhQ8g3UlFHrkF26hgvjZD7r9uHGDCH2I0v1SO9eGkxrVaf22M011ouDruikXfFA== X-Received: by 2002:a2e:a4a8:0:b0:249:6444:d29a with SMTP id g8-20020a2ea4a8000000b002496444d29amr26968957ljm.447.1649862759939; Wed, 13 Apr 2022 08:12:39 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id q21-20020a05651232b500b0046bacf73c9fsm514019lfe.151.2022.04.13.08.12.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Apr 2022 08:12:39 -0700 (PDT) Message-ID: <572f6010-a544-2f28-c466-e07192f7d244@gmail.com> Date: Wed, 13 Apr 2022 22:12:37 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Content-Language: en-US To: Paul Eggert , 54764@debbugs.gnu.org References: <5ed963b2-3fa8-48d8-627e-bc0571d15b43@gmail.com> <149de00f-115b-5367-414f-c7700ef8966b@cs.ucla.edu> From: Max Nikulin X-Woof-Patch: Use -1 (guess) instead of nil (no) for DST value in encode-time arguments In-Reply-To: <149de00f-115b-5367-414f-c7700ef8966b@cs.ucla.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=manikulin@gmail.com; helo=mail-lj1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649862807; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Z0UZsaFSc6s1PGLHJAzWDyQj3Ov04G96vHdXxhtC10k=; b=g2m5awFUh4Wy9mNTHDUVYpHJ4vmiMYl/6d31o6uZysSE6AjM4qWZHvvP3wcKjVWyBArz/3 i2g5B2viYdvvqGfBpjsqhxReyPEB2GZt7FfRicYcPutNZiW9Bg7IdpxuZHJ9wyqpVq6J+L TjsxoBNHTzNAy1XE3xkgd26fHEpgAcN5VCcM0M+9OSfH72P5I8KtsO/rTg1fW1U03o3VDD 9DBNRRSlTzgb9Z/DiFJseapi8HLFS7sCENHolkYI1Xv3tkNuRCAGcvQ+WNTnQRZ+9RYmAq 1XdwUcsLUIA9R2VlWWIVFgaNvmQbf4Fe/ms5WnXX/BQxjKFoOwAwnASdWWW06g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649862807; a=rsa-sha256; cv=none; b=hHnyjMJHtcnoQtTcuWtwtPDPao13PlJDNI2qQUTo63rv77twU4pvcgi03WCpiikGTcqPpp y0MdefONwCqv2eQe5p4I3kw+zAbH6GNQXEL6Rax6YiB2KQlkYx7zl35VsL86yPZrIWepN2 FOeHHO7Jn16FmFLHrOTx3Pv9WO+KiVbdtHImfIqssm+XaktvB4OKRIpxSS+MFstx8BK6gh pirIPUzOuL/cbkAkDqPcUWOQK3ypEKQ7uAc6oqJKyg/EHdhnoMV+N8NKP9ucDy8G94xwev wYMFQKRcd/oTXiTP6zD7b01znOZF8fDe9TR4opv7UIwvO4rsGXfXg9I3XPO+jA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ICQZ+4qj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=ICQZ+4qj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 00FE42E365 X-Spam-Score: 5.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: q8L1rbU14AIL On 09/04/2022 14:52, Paul Eggert wrote: > 0001-Improve-Org-usage-of-timestamps.patch > > From 094345e10ad45e06f7b32e2f8017592210f43463 Mon Sep 17 00:00:00 2001 > From: Paul Eggert > Date: Sat, 9 Apr 2022 00:17:09 -0700 > Subject: [PATCH] Improve Org usage of timestamps > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > The main thing is to follow the (encode-time X) convention where > X’s DST component of nil means standard time, -1 means unknown. I am marking this thread as a patch for https://updates.orgmode.org "Use -1 (guess) instead of nil (no) for DST value in encode-time arguments" From my point of view the changes quoted below are most important ones in the patch and they should be committed to the Org repository. Preferably a unit test for time zones should be added for `org-parse-time-string'. I omitted changes to improve code style, they should be applied as well, I just consider them as having less priority. I am in doubt concerning `org-encode-time-1' part. > diff --git a/lisp/org/ol.el b/lisp/org/ol.el > index a03d85f618..fe6e97e928 100644 > --- a/lisp/org/ol.el > +++ b/lisp/org/ol.el > @@ -1575,9 +1575,7 @@ org-store-link > (setq link > (format-time-string > (car org-time-stamp-formats) > - (apply 'encode-time > - (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd) > - nil nil nil)))) > + (encode-time 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd)))) > (org-link-store-props :type "calendar" :date cd))) > > ((eq major-mode 'w3-mode) It allows to avoid a pitfall with nil as DST value. > diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el > index b10725bd52..0916da89ac 100644 > --- a/lisp/org/org-macs.el > +++ b/lisp/org/org-macs.el > @@ -1242,7 +1242,7 @@ org-parse-time-string > (string-to-number (match-string 4 s)) > (string-to-number (match-string 3 s)) > (string-to-number (match-string 2 s)) > - nil nil nil)) > + nil -1 nil)) It definitely must be changed in the Org code. > diff --git a/lisp/org/org.el b/lisp/org/org.el > index d656a51591..1bceb0f53a 100644 > --- a/lisp/org/org.el > +++ b/lisp/org/org.el > @@ -14334,7 +14334,7 @@ org-read-date-analyze > (setq year (nth 5 org-defdecode)) > (setq org-read-date-analyze-forced-year t)))) > (setq org-read-date-analyze-futurep futurep) > - (list second minute hour day month year))) > + (list second minute hour day month year nil -1 nil))) > > (defvar parse-time-weekdays) > (defun org-read-date-get-relative (s today default) Unsure concerning adding extra elements. I would prefer change of `encode-time' in future and a compatibility macro as in the following for a while. Max Nikulin [DRAFT][PATCH] org-encode-time compatibility and convenience helper. Mon, 11 Apr 2022 22:22:48 +0700. https://lsit.orgmode.org/7f4ea652-7d22-fb61-f873-5e92f078c9e6@gmail.com