From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AAbBM1Hm2GRJ2gAASxT56A (envelope-from ) for ; Sun, 13 Aug 2023 16:18:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GNWPMlHm2GRT8gAAG6o9tA (envelope-from ) for ; Sun, 13 Aug 2023 16:18:57 +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 5A835686CD for ; Sun, 13 Aug 2023 16:18:57 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=f8PUtkQU; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691936337; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=lNaQOJ4gGzG0K+OlH3kDr8rxV3so2ZwDTISxSyJx7mo=; b=hIcZHSCiU+d/cYc3e/Vn8Y+l8uSAiJq2v6AFEfUgUP8KqsxNpPTr95MwgJtZ2XEqlFcLkA mkhDWQamz17/MYY6SPbGK9XrLtqBv29Lio4ZWPq8A2Ub00CgHlT2gr8K4+O7jyHmslVDNX AasrBEVzKbWVS3/+tIi5Tx4OcCD4deL5CMXhIVrubOqesZU7xrFbw3zEzrTpGDRHK9GGRi PSNDNdf1q6JlL/AObyXh4cfYCCEPn12DMLi3DGxgtRRKIUXxAYhOpzQ8/3JiXJ0Nzijv6p H7B34jxHQ0jlZySC1Y+3JT9X9uoDfjH1/u0caUxW+oz1/CAnBKgMPM/HLu7aag== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=f8PUtkQU; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691936337; a=rsa-sha256; cv=none; b=HVg5KIzWV6seG7gB3szkBK7siFnH/UD9zDh01IQ5tafq2LeDP2T1xjrXi7sHkZsazZBJLi tUekkHMcgK5GuMCeQTu+k+npX4et/gMLRcXZqQHT+pr6gI3c9Gr0poqCDL2ON5gv/fZq/c zqN1/JmL0T/Q8kfeCxpMrc5Xt6IctxLsQDsxnVVQkphoy2mbHeTx8dTZicYGJskyD/avgM eymAuB4eL4jX/PQgXy1fFMNcmBPxSAQFLfu4hSJlkeIqWBZhxdTcVFvZFxxUk2S6Athhvw qzVnFdbh+FvMK21xw0qx3h0pvEgR8+F7RTLOmTvWUeQoRjoTaxC3Qg5YoRSbhA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVBtz-0003hW-9P; Sun, 13 Aug 2023 10:17:07 -0400 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 1qVBtv-0003Mk-2V for emacs-orgmode@gnu.org; Sun, 13 Aug 2023 10:17:04 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVBtr-0001bK-E8 for emacs-orgmode@gnu.org; Sun, 13 Aug 2023 10:17:02 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E9B3D240101 for ; Sun, 13 Aug 2023 16:16:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1691936211; bh=z8OvVNSHDtlojq3d5anqWSfsEaNhRAZyNyJkJ2x5qH0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=f8PUtkQUSaIuhEmHRHLLughCxlAaO64z5X6G5GvNQTXTaXBjPKbAPQ0mOLElZx2eQ etO/+U1ax2ewPFKjogcljdvVgDznsuYHkf1sV1+HMgMchPUQz+lAsv4WEvIytUNGEF 00JySCXLPXoxWFHNPmWQ/BlOa72apmwaxXxlcw6xH8at5BoZfxcOXfW/uib3Af3KR8 YfEhSlrUAo4p3SDsvgGQzwkj3OQ9wQfNiQJHrVMhs1nVry/GpTZBmkZJM4oJBzL4Vq xgReMxZDrEnl9sZ1cX9N5pShN8EQkvvbKuHBqf2aksgHYjrMpFl1/S23rfR0Du6WQ2 +y58CZK58O3iQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RP02q3Dxbz9rxQ; Sun, 13 Aug 2023 16:16:51 +0200 (CEST) From: Ihor Radchenko To: "Valentin G. J. Herrmann" Cc: "Valentin Herrmann via General discussions about Org-mode." Subject: Re: [PATCH] org.el: Respect org-extend-today-until in timestamps with ++ In-Reply-To: References: <20230813091806.1435284-1-me@valentin-herrmann.de> <87il9jf7yw.fsf@localhost> <87fs4nf6wv.fsf@localhost> Date: Sun, 13 Aug 2023 14:17:18 +0000 Message-ID: <87zg2vdo29.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H5=-1, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -6.49 X-Migadu-Queue-Id: 5A835686CD X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -6.49 X-TUID: IThY//aeO1m+ "Valentin G. J. Herrmann" via "General discussions about Org-mode." writes: > In the attachments is a better version with tests that also addresses > your latest critique. Thanks! > + (setq time > + (save-match-data > + (org-time-string-to-time ts))) > + (unless (equal what "h") > + (setq time > + (time-add time > + (seconds-to-time (* 3600 org-extend-today-until))))))) Another corner case: (setq org-extend-today-until 4) * TODO Heading <2023-08-12 Sat 17:00 ++1d> Timestamp a bit (< 4 hours) earlier than current wall time C-c C-t d * TODO Heading <2023-08-13 Sun 17:00 ++1d> Expected: * TODO Heading <2023-08-14 Mon 17:00 ++1d> I generally feel that the approach with `time-add' will have a number of weird corner cases. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at