Currently, the following two user options have hardcoded effects:
org-node-extract-leave-link-in-source
org-node-extract-add-inherited-tags
Also, the command org-node-extract-subtree has a docstring that includes an advice-snippet as a tip:
[...]
Adding to that, see below for an example advice that copies any
inherited "CREATED" property, if an ancestor had such a
property. It is subjective whether you'd want this behavior,
but it can be desirable if you know the subtree had been part of
the source file for ages so that you regard the ancestor's
creation-date as more truthful or useful than today's date.
(advice-add 'org-node-extract-subtree :around
(defun my-inherit-creation-date (orig-fn &rest args)
(let* ((ancestor-crtime (org-entry-get nil "CREATED" t))
(crtime-putter
(lambda ()
(org-entry-put nil "CREATED"
(or ancestor-crtime
(org-node-time-stamp t t))))))
(add-hook 'org-node-relocation-hook crtime-putter)
(add-hook 'org-node-creation-hook crtime-putter)
(unwind-protect (apply orig-fn args)
(remove-hook 'org-node-relocation-hook crtime-putter)
(remove-hook 'org-node-creation-hook crtime-putter)))))
Ideally, all the above could be covered by some hooks. Much easier to customize.
We already have org-node-relocation-hook, but we need one that runs in the source buffer as well, after the extract has happened.
Also, org-node-relocation-hook takes no arguments, which was probably a mistake. We need to replace it with something like "org-node-relocation-functions". Maybe it can take markers for both the source and target buffers.
Currently, the following two user options have hardcoded effects:
org-node-extract-leave-link-in-sourceorg-node-extract-add-inherited-tagsAlso, the command
org-node-extract-subtreehas a docstring that includes an advice-snippet as a tip:Ideally, all the above could be covered by some hooks. Much easier to customize.
We already have
org-node-relocation-hook, but we need one that runs in the source buffer as well, after the extract has happened.Also,
org-node-relocation-hooktakes no arguments, which was probably a mistake. We need to replace it with something like "org-node-relocation-functions". Maybe it can take markers for both the source and target buffers.