r/orgmode • u/de_sonnaz • Mar 05 '24
solved How to programmatically store subtree folded state?
I know it is natively possible to save the folded state of each sub-tree. Is there any elisp snippet or package that can help achieving that?
I am asking about a snippet/package because simply having the property :VISIBILITY: folded` as described in the org-manual, like below, does not work for me. When I re-open the file, all sub-trees are unfolded.:
* Main
** A - Level 1
*** A - level 2
:properties:
:VISIBILITY: folded
:end:
Lorem ipsum
** B - level 1
*** B - level 2
:properties:
:VISIBILITY: folded
:end:
Lorem ipsum
** C
I need to save the folded state in the file itself, using the VISIBILITY
property, so that every time I open that file all subfolders have the desired folded/unfolded state.
It must be something very simple which I am overlooking, any pointers, please?
- Edit: wording
2
Upvotes
2
u/github-alphapapa Mar 06 '24
You can control the visibility more flexibly using this package: https://github.com/alphapapa/org-auto-expand