org-save-outline-visibility

org-save-outline-visibility is a Lisp macro in `org-macs.el'.

(org-save-outline-visibility USE-MARKERS &rest BODY)

Save and restore outline visibility around BODY.
If USE-MARKERS is non-nil, use markers for the positions.
This means that the buffer may change while running BODY,
but it also means that the buffer should stay alive
during the operation, because otherwise all these markers will
point nowhere.