Docs state that -match functions apply to children of node. Since the root node is not a child of itself it does not get transformed when using org-ml-match-map functions for instance.
Often when working on subtrees, though I want to transform both the root node and its children subject to a match condition, so I am currently using a workaround along the lines below. However most likely there is a more elegant way to do this by using a proper wrapper or parameter which includes the root node in the processing:
(defun my--match-map-incl-root(node-type fun node)
(->> (if (org-ml-is-type node-type node)
(funcall fun node)
node)
(org-ml-match-map `(,node-type) fun)))
Docs state that -match functions apply to children of node. Since the root node is not a child of itself it does not get transformed when using
org-ml-match-mapfunctions for instance.Often when working on subtrees, though I want to transform both the root node and its children subject to a match condition, so I am currently using a workaround along the lines below. However most likely there is a more elegant way to do this by using a proper wrapper or parameter which includes the root node in the processing: