From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aLt3DwbcTmIuRQAAgWs5BA (envelope-from ) for ; Thu, 07 Apr 2022 14:41:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GFgUCAbcTmIcZgEAG6o9tA (envelope-from ) for ; Thu, 07 Apr 2022 14:41:42 +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 9C1DA16518 for ; Thu, 7 Apr 2022 14:41:41 +0200 (CEST) Received: from localhost ([::1]:38450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncRSG-0000Sm-PL for larch@yhetil.org; Thu, 07 Apr 2022 08:41:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncRPj-00082K-44; Thu, 07 Apr 2022 08:39:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncRPi-0007up-Ow; Thu, 07 Apr 2022 08:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ncRPh-0007mb-US; Thu, 07 Apr 2022 08:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Resent-From: Max Nikulin Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org, eggert@cs.ucla.edu, bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Apr 2022 12:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54764 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 54764@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: emacs-orgmode@gnu.org,eggert@cs.ucla.edu Received: via spool by submit@debbugs.gnu.org id=B.164933512329890 (code B ref -1); Thu, 07 Apr 2022 12:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Apr 2022 12:38:43 +0000 Received: from localhost ([127.0.0.1]:60130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncRPO-0007m2-SH for submit@debbugs.gnu.org; Thu, 07 Apr 2022 08:38:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:52904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ncRPM-0007lt-Ni for submit@debbugs.gnu.org; Thu, 07 Apr 2022 08:38:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncRPM-0007tE-Gs for bug-gnu-emacs@gnu.org; Thu, 07 Apr 2022 08:38:40 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:36472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ncRPH-0007i2-Sc for bug-gnu-emacs@gnu.org; Thu, 07 Apr 2022 08:38:40 -0400 Received: by mail-lf1-x130.google.com with SMTP id i38so1079411lfv.3 for ; Thu, 07 Apr 2022 05:37:47 -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:to:content-language :from:subject:content-transfer-encoding; bh=m6Y9XsO70yab9ndcSQh9CTZY0l596tqXWziDhmEqQTQ=; b=pbeZTNWLRf7Z2a93a9wytAkHR2irhCmbaDEgQS3qyOqemyP7KNUV4KujeanmXAJqR5 k8BLm96a59s4OUScqW8Erfaro8Nkt+jR09eAaRpadagsNZ0Y+oXY6hi/RX16Vb5CGveE gTtYcMiGISqwdqVO3TXzfYoqsyTbRhe7QudXF/2HUy1V63KrZUqvDwcfW/AE6a4uxm9T JjSnUuSyqEB1BRKWMwjfsAKylcLryxp2J/kOfYwXUhLkf1BWz0LjW5drQcrrlw2pFHAL MNJBlBgGGGVkwZGijVx9tccY8cE/C5UDGOfgihNKaCAP4IBBuHEaxJA1JWNgsmvxspXc 6XqA== 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 :to:content-language:from:subject:content-transfer-encoding; bh=m6Y9XsO70yab9ndcSQh9CTZY0l596tqXWziDhmEqQTQ=; b=qUJVz6hRu8c7AFgP3YW6uVxtp+EnyIFh3qUVkB5rGYHr5xfArflm8MZYWcpOj6LzLQ oFdAKALU+Mv9riShWvf1lMKvbVQdblhAAvkDl/pSh9DhdIsD+bQtO+HTlDgoP5SP2uvB A124WhF03gQ6nZZ5gl8R4iokMlTQye6cCIkdpQysOETHX9S8FMiX4owm1ZypyxFvGs0b ke5eqr2EsxAvjF3S024KW+SkKVkMNGMlRM/G5UVQwq1kpnueBxMReBkY5FMoaZOyA390 M9I0tw8D609i1blAU3MnoKk92v5LcTBbTMcjgGLObSxjqbn1okvqKdbNzCPiSkH2bBlD GSsA== X-Gm-Message-State: AOAM532P7vDaMtbGKJPOJGCrvLpB5urVq0svzkCGvd8oc54PpGVPmpct U8hLr7Uh2WksH7LptMi/8/VLgdnzR2w= X-Google-Smtp-Source: ABdhPJwhmtdgvzZjwybuzzpolf8uSJVXizP39zqK0ZfRvQWDA3esN587ql7ycf1vI5bwA9324bmYnw== X-Received: by 2002:a05:6512:304a:b0:44a:c4a4:8e9d with SMTP id b10-20020a056512304a00b0044ac4a48e9dmr9206919lfb.624.1649335065596; Thu, 07 Apr 2022 05:37:45 -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 d11-20020a05651233cb00b0044ae32872fdsm1991872lfg.147.2022.04.07.05.37.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Apr 2022 05:37:45 -0700 (PDT) Message-ID: <5ed963b2-3fa8-48d8-627e-bc0571d15b43@gmail.com> Date: Thu, 7 Apr 2022 19:37:43 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US From: Max Nikulin Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=manikulin@gmail.com; helo=mail-lf1-x130.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, 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: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eggert@cs.ucla.edu, 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=1649335301; 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:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=m6Y9XsO70yab9ndcSQh9CTZY0l596tqXWziDhmEqQTQ=; b=CV0t4yxQZp0X6KfVUWAVcCgRGzJBsJ3wCM6RRGT1ZO1LG9gcjbK5IiKtorTY+LPSksw84r PV7v7Os9FCMvLkAES0ZocVMotfbBdl7nqmKSyAZ4o4CsjzzzD+Qf08qvQS3apVuMJiJrn+ WOUNko3F8QuF9d16S+CniLoKQPOvmYhNE2GpylXpHJp4WuMvLpNLSzdbRlJfS3A3t5D9VE evMo1nLh+KNRcohQyUa7buHNaJzUxUdSG3fPEFuZFAeC2Pud9N8R8Yvkf12xiiZzW279U6 eGsVL2GqcOTU8Cd10ei8NLSqTTyTLhc7Lgv7Uj/G34VvppPL6B5tuOPGZfEy4g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649335301; a=rsa-sha256; cv=none; b=eWmXq+07Fvxz8jdEGsVLVbWppFkXOQiXEI8FTGWX4QaUkRGsAP+GH5dcgVih6juxbBJpf3 dRNlVS7ilm6QsTjkqZwNDxfZjHrzp606kviu5oAU5LobcjekgHc9fUe7yXCuuAqSWX+La6 VOB/HWFfr8WEmNpRd2S28ks9DMkrEXZNSWncipilVdJQCJTkayKkJGipmgO1OpggFBvYci ZCN2uWZqUxdjUHszS0axomV2a6nW03OGYI0qUyKcyWix8CTJp0+eWGvxIa+t9Un+uiT7AS trWq2sva+VOoTMYQpVXvWY9WMjMpPc0+J0rUf7aaoHPYoz4Vjq68jBmmP9AJvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pbeZTNWL; 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.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pbeZTNWL; 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: 9C1DA16518 X-Spam-Score: 5.74 X-Migadu-Scanner: scn1.migadu.com X-TUID: ZoXc3Zmq+xuM Consider the following change of `encode-time' calling convention: last 3 elements of the TIME argument as a list should be optional. I mean IGNORED, DST, and ZONE. (encode-time '(0 30 20 07 04 2022 nil -1 nil)) (encode-time '(0 30 20 07 04 2022)) ; currently causes an error Since Emacs-27 time fields as separated arguments are considered obsolete for calls of `encode-time'. Org mode keeps compatibility with Emacs-26 where passing all time components as a single list is not supported. Moreover, some time ago an attempt to use new style argument in the Emacs git repository (the change was never committed to the Org repository) caused a bug with handling of daylight saving time. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54731 for more details, the commit reverted the changes is 8ef37913d3. I have tried to create a compatibility wrapper for Org mode that chooses calling convention of `encode-time' in dependence of Emacs version. I have realized that there are enough call sites where components of time are gathered from scratch and not obtained from e.g. prior call of `decode-time'. It is inconvenient to add 3 extra mandatory components at the each place. I am reluctant to add a helper that accepts 6-components list and adds 3 fields to the end of the list. I am afraid that it may affect e.g. agenda performance. From my point of view it is better to change implementation of `encode-time' so that it may accept 6-component list SECOND...YEAR. It should not add noticeable performance penalty but makes the function more convenient in use. Old-style separate arguments for time components permits optional fields ended with ZONE. I do not mind that it should be deprecated since it is the source of surprise similar to the mentioned bug. Daylight saving time field matters only as a list component and ignored as a separate argument (by the way, it should be stressed in the docstring). It is too easy to confuse list and separate arguments in the code since both ways works but with a subtle difference: nil does not mean ignore the value. (encode-time '(0 30 20 07 04 2022 nil nil nil)) ; wrong! (encode-time 0 30 20 07 04 2022 nil nil nil) ; no problem In the Org code it is unsure which way to call `encode-time' is more convenient. In a half of the cases a list is obtained from another function, but another half is timestamp built from computed components. Unless the inconsistency with DST I would say that both ways to call the function should be supported. So my proposal is to not force Org mode to use new calling convention for `encode-time' till DST and ZONE list components will became optional ones in a released Emacs version. For a while minor changes in a couple of places in Org code should make it immune to accidental usage of new calling convention (modulo compatibility).