From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gPwlOk2tvWFx0QAAgWs5BA (envelope-from ) for ; Sat, 18 Dec 2021 10:43:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AB3GNU2tvWHXbwAAbx9fmQ (envelope-from ) for ; Sat, 18 Dec 2021 09:43:41 +0000 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 B08CC36C2C for ; Sat, 18 Dec 2021 10:43:41 +0100 (CET) Received: from localhost ([::1]:43790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myWFg-0002Ho-RW for larch@yhetil.org; Sat, 18 Dec 2021 04:43:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myWFJ-0002HZ-BX for emacs-orgmode@gnu.org; Sat, 18 Dec 2021 04:43:17 -0500 Received: from [2a00:1450:4864:20::232] (port=46065 helo=mail-lj1-x232.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1myWFH-0007An-Qq for emacs-orgmode@gnu.org; Sat, 18 Dec 2021 04:43:17 -0500 Received: by mail-lj1-x232.google.com with SMTP id b19so7104156ljr.12 for ; Sat, 18 Dec 2021 01:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=9+afYcdrNSSq+xYY/VPXzIP+MjO9IM8JmMisb81+15Q=; b=AE4qWGRvZC+8jrVbLnPNn5P4gC64A8zbNWYipzH6A1XThaf5wFGxjU6ORdi8dWTRlE VbCCphoaRU7Llrov9g3bnkcAaqrPvynN6FwIZgi2dzzCe7RzxJ7p+ucmNw4ixqxmn1Ki 5MDhU1jimhwjtUzNG8L24KVsTQp7QiP+DytKUii5TTf9UDqGGJKTScdFyqpZVIJOCSPt ZgGbcUmniqfLOfW5I3zchjx+cXQTfed4xxZtuRrs3YMzQkRW91/I894wegI1yPXo7PWI Iq5UCuPAk7oLd4fADsVTmRIAjSrTtIoSbnfTFc17/Kx84ldw0+Tlopf0hQ8wSPDOMDCd 36Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=9+afYcdrNSSq+xYY/VPXzIP+MjO9IM8JmMisb81+15Q=; b=pNKDTWS2BgEWebOfAKCIhCvI3vwqZiBo5MR8A6EhQnXPAx9TzyOg1R1Nt9QqnmuTNb FWqA3snB7rIzJQE7U65d6bmf1dNIkB+SBDcWbv8AN5hjWTmJdhOQMe6El8U5tg0ehqgZ MiWQyJP0mAexahLfpApwSf+5ugtas5sPU8PevI1XpBAWMKAUcn18kkANq6Ftm+C5MNCj ALOuaCTRGZutwtKcverVDLFCIb/yrY4dS45W4LpG1gfewKQ3BAld9dRX2PXbgs07zmw6 mLzcYhGmtaOJlbZ3Pa270By8zrhWLkHTd+8hC1CC/prLidy9VSAGQiJaXyYEjtNgMJUe sGLg== X-Gm-Message-State: AOAM530s4Rjs3thzWnVfeCZh/yy2PGh9mAs8LvIAIcHMgVIqtStQL7OV 94uPpC6hceBqgO8Nyvd4kvk= X-Google-Smtp-Source: ABdhPJwnoiFh6jlb0IO7sld0UnNXyPvteteJ6ct3cIcnIPnbbgYDcopi4k038DGAyfIzXd/D9IxmhA== X-Received: by 2002:a2e:95cb:: with SMTP id y11mr6114136ljh.461.1639820594028; Sat, 18 Dec 2021 01:43:14 -0800 (PST) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id w25sm577812lfl.33.2021.12.18.01.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 01:43:13 -0800 (PST) From: Ihor Radchenko To: Robert Nikander Subject: [PATCH] Re: [BUG] Manual says +2h works for date entry, but it doesn't In-Reply-To: References: Date: Sat, 18 Dec 2021 17:44:38 +0800 Message-ID: <871r2ackmx.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::232 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=yantar92@gmail.com; helo=mail-lj1-x232.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639820621; 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=9+afYcdrNSSq+xYY/VPXzIP+MjO9IM8JmMisb81+15Q=; b=G0vdQLX1aKz9J1ZXu977pCbGC5a6/689si05c849yqxiWhdI+t8i8LW8eWO1La9FpUE9ok q9c36iAv4JZ9IQpQ7J+J5GBlroLiYxEPRz3jbxbAp2DHBh9RSJYITs3JTEkmmZYMjMWO9k 4ZNjSHM0daqSojaY2ltHx2QVS+6egHtoGEl0Uc6e1PA1JtfR7EY4tbJrsAQpeiQ0yk9FYL zv28IRHM58zf9uMysTa9v4XtfXdlXS+rd7X74PMh6I8r8bOfLLHaQneXqSSzYIzB4WDizr UguguM8Aj1DO22wcsVek4DX+AzAgUHdfIoCRCbvAORk1AVWiN4lkoXT4ePBycA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639820621; a=rsa-sha256; cv=none; b=UazArlG3l4VuxKTS+wsUXOd5W+umzMp+ichrhmbkgBlJXLCzSyt8rDzjjvb+RBJFW+jbX6 Yt2iBUejvcBvtCQMQ2B0DKiyL/Bcpv4WScIr3acX+szePau0K09bqv71n9mkrDax3DZG72 +bNA7FmpHrig/y6U2Jr2uveihRk9pVeBlKzCfI09qArbOKx4Dba4gGilHVF3k+nR8xKcUi EGkH5ntX1OArIFJFSsq0sRD93I389TsBi4SVwzSmPfWbYJKYD7L2Alxl/OtsgeruOln44P DzGvPYYXJlqVNU7FchZ5RHAtybCwQFYwJDLtcrQfp2Ad5PswMIOKaYRl6oJr6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AE4qWGRv; dmarc=pass (policy=none) header.from=gmail.com; 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.30 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=AE4qWGRv; dmarc=pass (policy=none) header.from=gmail.com; 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: B08CC36C2C X-Spam-Score: -5.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: ftvUgRk9Rd+U --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Robert Nikander writes: > The manual here: https://orgmode.org/manual/The-date_002ftime-prompt.html > > says that you can use syntax like `+2h` when entering timestamps. It does= n=E2=80=99t=20 > seem to work, but `+2d` does. Is the manual simply out of sync with the > implementation? I can confirm that +2h syntax is not supported. The attached patch makes hours work in the time prompt. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Date-time-prompt-Allow-input-of-relative-time-in-hou.patch >From 21e0680c1443bc3dc3b025f5782276edcf3a7ada Mon Sep 17 00:00:00 2001 Message-Id: <21e0680c1443bc3dc3b025f5782276edcf3a7ada.1639820517.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 18 Dec 2021 16:33:57 +0800 Subject: [PATCH] Date/time prompt: Allow input of relative time in hours (e.g. +1h) * lisp/org.el (org-read-date-analyze): Match relative hour specifier. Fixes https://orgmode.org/list/C9A76EFA-1D76-4C5D-941D-AFA288A64CD0@icloud.com --- lisp/org.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ce4e08eab..393f45f26 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14536,10 +14536,14 @@ (defun org-read-date-analyze (ans def defdecode) (unless deltadef (let ((now (decode-time))) (setq day (nth 3 now) month (nth 4 now) year (nth 5 now)))) - (cond ((member deltaw '("d" "")) (setq day (+ day deltan))) - ((equal deltaw "w") (setq day (+ day (* 7 deltan)))) - ((equal deltaw "m") (setq month (+ month deltan))) - ((equal deltaw "y") (setq year (+ year deltan))))) + (cond ((member deltaw '("h" "")) + (when (boundp 'org-time-was-given) + (setq org-time-was-given t)) + (setq hour (+ hour deltan))) + ((member deltaw '("d" "")) (setq day (+ day deltan))) + ((equal deltaw "w") (setq day (+ day (* 7 deltan)))) + ((equal deltaw "m") (setq month (+ month deltan))) + ((equal deltaw "y") (setq year (+ year deltan))))) ((and wday (not (nth 3 tl))) ;; Weekday was given, but no day, so pick that day in the week ;; on or after the derived date. -- 2.32.0 --=-=-=--