Function: org-fold-core-save-visibility
org-fold-core-save-visibility is a macro defined in
org-fold-core.el.gz.
Signature
(org-fold-core-save-visibility USE-MARKERS &rest BODY)
Documentation
Save and restore folding state 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 to nowhere.
Aliases
org-save-outline-visibility
org-fold-save-outline-visibility
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-fold-core.el.gz
(defmacro org-fold-core-save-visibility (use-markers &rest body)
"Save and restore folding state 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 to nowhere."
(declare (debug (form body)) (indent 1))
(org-with-gensyms (regions)
`(let* ((,regions (org-fold-core-get-regions :with-markers ,use-markers)))
(unwind-protect (progn ,@body)
(org-fold-core-regions ,regions :override t :clean-markers t)))))