org-pre-cycle-hook

org-pre-cycle-hook is a variable defined in `org.el'.
Its value is
nil

  • This variable may be risky if used as a file-local variable.

Documentation:
Hook that is run before visibility cycling is happening.
The function(s) in this hook must accept a single argument which indicates
the new state that will be set right after running this hook. The
argument is a symbol. Before a global state change, it can have the values
`overview', `content', or `all'. Before a local state change, it can have
the values `folded', `children', or `subtree'.

You can customize this variable.