From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UFYJBbLbNWC9eQAA0tVLHw (envelope-from ) for ; Wed, 24 Feb 2021 04:53:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qA/eALLbNWCDJgAA1q6Kng (envelope-from ) for ; Wed, 24 Feb 2021 04:53:06 +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 4C3B7295BB for ; Wed, 24 Feb 2021 05:53:05 +0100 (CET) Received: from localhost ([::1]:50734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEmAa-0004Wk-8k for larch@yhetil.org; Tue, 23 Feb 2021 23:53:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEm9g-0004WU-9M for emacs-orgmode@gnu.org; Tue, 23 Feb 2021 23:52:08 -0500 Received: from out1.migadu.com ([2001:41d0:2:863f::]:11563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEm9c-0006qs-Pw for emacs-orgmode@gnu.org; Tue, 23 Feb 2021 23:52:08 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1614142321; h=from:from: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; bh=prbliun7wzML0X3mJuP7DxQoDcuUAA3rEB0/dKRp+Ew=; b=RctKX/E1+aVSKWJQ0aGlYE6wMbDCHPqtYebnop6mcSeuF3/DxsaX2dXF08IFaVBnxfVp0y 6TaZvwBe5haPcZ0V2N4wr1P2W+ikX1vtPYrRwoekb7venxgRtMmKEYukDU3RhNFAWuBM1i EWLq+QpVCq8T992CbcT+vxs56bBFQSJpFgRtdnVXXbHcVYJDBczEU7YU+GOZDjPSZ8HULT kl6b07Yiajvul5hJHTq9pTbgHvrhggyWGHaey4ND71id2w5f9SKOaGK4f13vu7dKU7n4Es qulVAS7FM3kbbz4hhekDPB7326WVZ4qKJSx30JIeC2P3Z7+0m42LsVuOivcGVA== From: Kyle Meyer To: Felipe Barros Subject: Re: Bug: org-clone-subtree-with-time-shift invalid interval when using hours [9.3 (release_9.3 @ /usr/local/share/emacs/27.1/lisp/org/)] In-Reply-To: References: Date: Tue, 23 Feb 2021 23:51:59 -0500 Message-ID: <87czwqvzio.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=2001:41d0:2:863f::; envelope-from=kyle@kyleam.com; helo=out1.migadu.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, 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.23 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-Spam-Score: -2.57 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b="RctKX/E1"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4C3B7295BB X-Spam-Score: -2.57 X-Migadu-Scanner: scn1.migadu.com X-TUID: 5o65A2lg982p Felipe Barros writes: > Running org-clone-subtree-with-time-shift and entering an hourly > interval returns an error that the shift specification is invalid. > > For example, entering +8h returns: > > user-error: Invalid shift specification +8h [...] > And the Info page for Repeated Tasks states that: > >> You can use yearly, monthly, weekly, daily and hourly repeat cookies >> by using the =E2=80=98y=E2=80=99, =E2=80=98w=E2=80=99, =E2=80=98m=E2=80= =99, =E2=80=98d=E2=80=99 and =E2=80=98h=E2=80=99 letters. > > So, as I couldn=E2=80=99t find a reference to this limitation anywhere, I > believe this is a valid bug. I'm guessing h was left off for this command because it didn't seem too useful. But something like below should work (untested), and I don't see any particular reason to not support h. diff --git a/lisp/org.el b/lisp/org.el index 7d8733448..00596564f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7906,7 +7906,7 @@ (defun org-clone-subtree-with-time-shift (n &optional= shift) ""))) ;No time shift (doshift (and (org-string-nw-p shift) - (or (string-match "\\`[ \t]*\\([+-]?[0-9]+\\)\\([dwmy]\\)[ \t]*\\'" + (or (string-match "\\`[ \t]*\\([+-]?[0-9]+\\)\\([hdwmy]\\)[ \t]*\\= '" shift) (user-error "Invalid shift specification %s" shift))))) (goto-char end-of-tree) @@ -7916,6 +7916,7 @@ (defun org-clone-subtree-with-time-shift (n &optional= shift) (shift-n (and doshift (string-to-number (match-string 1 shift)))) (shift-what (pcase (and doshift (match-string 2 shift)) (`nil nil) + ("h" 'hour) ("d" 'day) ("w" (setq shift-n (* 7 shift-n)) 'day) ("m" 'month)