When using org build subtree navigation functions to move around, I want to show all the content of current one recursively, and hide any other subtrees that having a higher or same level of the current one. How to achieve this ? Thanks !
Edited in response to first comment
Not quite sure if this is what you want, but here's a function that will show the current subtree (and its children) and fold all other headings to their top level:
(defun ess/org-show-just-me (&rest _) "Fold all other trees, then show entire current subtree." (interactive) (org-overview) (org-reveal) (org-show-subtree))
Now you can add advices for each command you want to use this function together with:
(advice-add 'org-forward-heading-same-level :after #'ess/org-show-just-me) (advice-add 'org-backward-heading-same-level :after #'ess/org-show-just-me)
Another alternative is to use
org-narrow-to-subtree to hide all other content than the current subtree. It is bound to
C-x n s by default. To go back, use
widen, bound to
C-x n w. A great alternative is narrow-or-widen-dwim.
You could add
widen followed by
org-narrow-to-subtree to a function and create this as an advice in the same way as the example above.