Karl Voit <devn...@karl-voit.at> writes: > Hi! > > I wrote a blog article on how I am using Org with recurring events > or tasks: > http://karl-voit.at/2017/01/15/org-clone-subtree-with-time-shift/ > > As Michael Maurer stated in a comment below, > org-clone-subtree-with-time-shift does not ask for time-shift > depending on the location of the cursor.
I think org-back-to-heading should be called before the timestamp search: --8<---------------cut here---------------start------------->8--- Subject: [PATCH] org-clone-subtree-with-time-shift: Fix timestamp search * lisp/org.el (org-clone-subtree-with-time-shift): Move to the beginning of the heading before the timestamp search so that the user will be prompted for a time shift even if point is after the timestamp. This also prevents an "Invalid search bound" error if point is on the blank line following a body-less heading: * single line <2017-02-28 Wed> <point here> Reported-by: Karl Voit <devn...@karl-voit.at> <http://permalink.gmane.org/gmane.emacs.orgmode/111456> --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 3c27f642a..f0ff80f68 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8976,6 +8976,7 @@ (defun org-clone-subtree-with-time-shift (n &optional shift) remove the repeater from a subtree and create a shifted clone with the original repeater." (interactive "nNumber of clones to produce: ") + (org-back-to-heading t) (let ((shift (or shift (if (and (not (equal current-prefix-arg '(4))) @@ -9005,7 +9006,6 @@ (defun org-clone-subtree-with-time-shift (n &optional shift) ("m" . month) ("y" . year)))))) (when (eq shift-what 'week) (setq shift-n (* 7 shift-n) shift-what 'day)) (setq nmin 1 nmax n) - (org-back-to-heading t) (setq beg (point)) (setq idprop (org-entry-get nil "ID")) (org-end-of-subtree t t) -- 2.11.0 --8<---------------cut here---------------end--------------->8--- -- Kyle