Function: org-cycle-set-startup-visibility

org-cycle-set-startup-visibility is a byte-compiled function defined in org-cycle.el.gz.

Signature

(org-cycle-set-startup-visibility)

Documentation

Set the visibility required by startup options and properties.

Aliases

org-set-startup-visibility (obsolete since 9.6)

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-cycle.el.gz
(defun org-cycle-set-startup-visibility ()
  "Set the visibility required by startup options and properties."
  (cond
   ;; `fold' is technically not allowed value, but it is often
   ;; intuitively tried by users by analogy with #+STARTUP: fold.
   ((memq org-startup-folded '(t fold overview))
    (org-cycle-overview))
   ((eq org-startup-folded 'content)
    (org-cycle-content))
   ((eq org-startup-folded 'show2levels)
    (org-cycle-content 2))
   ((eq org-startup-folded 'show3levels)
    (org-cycle-content 3))
   ((eq org-startup-folded 'show4levels)
    (org-cycle-content 4))
   ((eq org-startup-folded 'show5levels)
    (org-cycle-content 5))
   ;; `nofold' and `showall' are technically not allowed values, but
   ;; they are often intuitively tried by users by analogy with
   ;; #+STARTUP: nofold or #STARTUP: showall.
   ((memq org-startup-folded '(showeverything nil nofold showall))
    (org-fold-show-all)))
  (unless (eq org-startup-folded 'showeverything)
    (when org-cycle-hide-block-startup (org-fold-hide-block-all))
    (org-cycle-set-visibility-according-to-property)
    (org-cycle-hide-archived-subtrees 'all)
    (when org-cycle-hide-drawer-startup (org-cycle-hide-drawers 'all))
    (org-cycle-show-empty-lines t)))