I typed M-x find-function RET org-cut-subtree RET
and saw that it was just a few lines of code that calls org-copy-subtree
. Then, I typed M-x find-function RET org-copy-subtree RET
and looked through about 25 lines of code to see if there were any built-in hooks -- I did not find any.
I recommend creating a new function called my-org-cut-subtree
to avoid any unintended side effects that would likely occur if the original poster tried to alter the behavior of the core functions at issue, since they are used by other aspects of org-mode
. I recommend using (insert "\n")
instead of newline
to insert a new line.
(defun my-org-cut-subtree (&optional n)
"Cut the current subtree into the clipboard.
With prefix arg N, cut this many sequential subtrees.
This is a short-hand for marking the subtree and then cutting it."
(interactive "p")
(org-copy-subtree n 'cut)
(insert "\n"))