branch: externals/org
commit d1e4b9351941aa9241ab3aa0a34256376b7eca94
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-copy-subtree: Do not consider inlinetask to be a subtree of its own
    
    * lisp/org.el (org-copy-subtree): Go up to parent heading when we are
    at or inside inlinetask.
---
 lisp/org.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index c037b3ee04..6abb2db958 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7096,6 +7096,9 @@ useful if the caller implements cut-and-paste as 
copy-then-paste-then-cut."
      (if (called-interactively-p 'any)
         (org-back-to-heading nil)    ; take what looks like a subtree
        (org-back-to-heading t))              ; take what is really there
+     ;; Do not consider inlinetasks as a subtree.
+     (when (org-element-type-p (org-element-at-point) 'inlinetask)
+       (org-up-element))
      (setq beg (point))
      (skip-chars-forward " \t\r\n")
      (save-match-data

Reply via email to