From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SN/CKcUhzWMY4gAAbAwnHQ (envelope-from ) for ; Sun, 22 Jan 2023 12:45:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aPHMKcUhzWM4ngAA9RJhRA (envelope-from ) for ; Sun, 22 Jan 2023 12:45:09 +0100 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 68F022F53D for ; Sun, 22 Jan 2023 12:45:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJYm1-0001nv-9l; Sun, 22 Jan 2023 06:44:33 -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 ) id 1pJYlz-0001nd-Jn for emacs-orgmode@gnu.org; Sun, 22 Jan 2023 06:44:31 -0500 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 1pJYlx-0001QX-1m for emacs-orgmode@gnu.org; Sun, 22 Jan 2023 06:44:31 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9F6EC2401ED for ; Sun, 22 Jan 2023 12:44:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674387866; bh=rOzAFhf46LBIyh4flyYYilAELkrKqgmiyx3OYuyIX+A=; h=From:To:Cc:Subject:Date:From; b=l9ElarveCvfPfbfq6FtNt+GkZN40gKfvlhphf1J/7EtYSyGCQAcKz/2bxiB0hPzRe X1nAnVrxXRkDtTfPuYXLP8VoxwTm32BhRT0TNXUoKcw/EoPn9lNXC+JlwoxkF5XRR/ KD8h0HLUmaZOJIkSFq/vK7Y2uUTp5XFr4C9iBDMEHDq3ydL120OCfsvX3bGlqscKsr Z292epW2L8qGp+opFjN4BYTq+D7o3M8fVkzFwkXty9hrhV0By+5PT+cgVPELKbRn+3 5YYHRnI2atosmwyz6511x0p3Ffwnt7959UCKGnzQrFT6PZN0UkfRlrQZlCqnmoqFxw s7CImiDVsGOHw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P0BGb0vTBz6tmY; Sun, 22 Jan 2023 12:44:22 +0100 (CET) From: Ihor Radchenko To: Tim Ruffing Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Date prompt suggests yesterday when changing timestamp with org-extend-today-until set [9.6] In-Reply-To: <3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de> References: <3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de> Date: Sun, 22 Jan 2023 11:44:53 +0000 Message-ID: <87zgaan68a.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.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_H2=-0.001, 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674387909; 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=aaG4lwNthiZeNEDoSYZmGLrgVmMRJohuj1wK+hiqThQ=; b=klIdp+z5dldKB8sNxI0ojtREv1zkVKAgflM/YnNt8ObTdwte3pczv7vP4aVph93yl5AYB3 IPQLSNOZlQuMGdsuiNsBcm79Y7LdvwqmUiifBy+t0o45qcGR+dVzUmUC1PzrUSjglzAR9U Tj1RN/rY79r/3jnv6sVxq/QLXnG9Z2e27W3SkZ/G2ptptlZuMhL+L366KB2TBLPbFBAHNG 2pL7kkTZC8Kn7Xo5pxzKUFThUHvLfImjkv6Er8m/qPc+RHRrRNNeDnXVm2VaF7v8trDwRr VG4KU48AITz0mJQDxyI5VNw16w+iQIPqiPAOfH99v3zGA2x2HukPnsknwtTXHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=l9Elarve; 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=1674387909; a=rsa-sha256; cv=none; b=gQ9T1ZtH+rTJ71xuZLMXQOFBS8+IIcFmqrR3I5fWFoyXCg4nACKo1YWuI7ujBg237R+Uzk SY5W6oieVJ655q41ZFjl6S520/v4xuk930BEdpyJJyQ8KkrU8OoL6xxL4Hj+8j8n5fSVKU VVmF762yChMXqrcJyRQaE90AMhQZ4sPildveijC8TDTRsXvmOymdhtT+9iNIUYR21C5g/G yq6+rQZRc+yGEyFJjOOz2ZHHsMDrA2ZAR+l3hfL45UowttqvpFRBFPqAc0yKL66z7K7d72 dPiHG+7z2wxjlYtsMesFxg7N1EYzGz37FfwEAo4+OjKirc3wwMATf2L1P47kEg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.54 X-Spam-Score: -4.54 X-Migadu-Queue-Id: 68F022F53D Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=l9Elarve; 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" X-TUID: 7cfdaI4e/GWT --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tim Ruffing writes: > Assume org-extend-today-until is set to an integer greater 0, say 3. > When I change a timestamp without date such as <2023-01-20> (e.g, when > rescheduling), the prompt defaults to a day earlier, i.e., to "2023-01- > 19" in this case. The same happens with <2023-01-20 01:00> which is > still before 3am.=C2=A0 Thanks for reporting! May you try the attached patch? I am, however, still concerned about how `org-read-date' is handling `org-extend-today-until'. If we have something like * This is test SCHEDULED: <2023-01-28 Sat> Then, M-: (setq org-extend-today-until 20) Then, C-c C-s on the heading above What will happen if one tries to do "." or +1 or ++1. I find the current behavior rather disorienting. Could someone check what we promise in the Org manual, `org-read-date' docstring, `org-extend-today-until' docstring, and what actually happens in practice? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-read-date-Do-not-consider-org-extend-today-until.patch >From 998f2f9b93f5727942fa0e53567288ebcf544764 Mon Sep 17 00:00:00 2001 Message-Id: <998f2f9b93f5727942fa0e53567288ebcf544764.1674387603.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sun, 22 Jan 2023 14:37:47 +0300 Subject: [PATCH] org-read-date: Do not consider `org-extend-today-until' with default time * lisp/org.el (org-read-date): When DEFAULT-TIME time provided, prefer it even when `org-extend-today-until' dictates -1 day shift. We should only consider `org-extend-today-until' for actual today times, not for future dates, where is becomes confusing. Reported-by: Tim Ruffing Link: https://orgmode.org/list/3489c1917ad4be0625ea5f0b2c1b0f2b72ea39e9.camel@timruffing.de --- lisp/org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 0e6a3da0a..f4cc7b4be 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13695,7 +13695,11 @@ (defun org-read-date (&optional with-time to-time from-string prompt (calendar-view-holidays-initially-flag nil) ans (org-ans0 "") org-ans1 org-ans2 final cal-frame) ;; Rationalize `org-def' and `org-defdecode', if required. - (when (< (nth 2 org-defdecode) org-extend-today-until) + ;; Only consider `org-extend-today-until' when explicit reference + ;; time is not given. + (when (and (not default-time) + (not org-overriding-default-time) + (< (nth 2 org-defdecode) org-extend-today-until)) (setf (nth 2 org-defdecode) -1) (setf (nth 1 org-defdecode) 59) (setq org-def (org-encode-time org-defdecode)) -- 2.39.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--