Nicolas Goaziou <m...@nicolasgoaziou.fr> writes: > Thank you. I applied your patch with an additional check.
Thanks. The additional check looks good, as it replaces an error with a more appropriate user-error and gives an error message that is a bit more specific. However, the re-positioning of the org-back-to-heading call seems problematic because the call is now wrapped in a save-excursion, but the downstream code expects point to be at the beginning of the heading. When I call org-clone-subtree-with-time-shift with point at the end of *** heading <2017-02-28 Wed> I get the following error: Debugger entered--Lisp error: (error "Before first headline at position 1 in buffer *temp*") signal(error ("Before first headline at position 1 in buffer *temp*")) error("Before first headline at position %d in buffer %s" 1 #<buffer *temp*>) (condition-case nil (outline-back-to-heading invisible-ok) (error (error "Before first headline at position %d in buffer %s" (point) (current-buffer)))) org-back-to-heading(t) org-end-of-subtree(t t) (save-excursion (org-end-of-subtree t t)) (outline-flag-region (point) (save-excursion (org-end-of-subtree t t)) nil) org-show-subtree() [...] org-clone-subtree-with-time-shift(2) funcall-interactively(org-clone-subtree-with-time-shift 2) call-interactively(org-clone-subtree-with-time-shift nil nil) command-execute(org-clone-subtree-with-time-shift) I think this is because beg isn't set to the beginning of the heading. But given Karl's recent email saying that the changes in maint fixed his test cases, maybe I'm missing something ... -- Kyle