Hi Nicolas,

>>>>> "N" == Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

    N> Hello, Roland Fehrenbacher <r...@q-leap.de> writes:

    >> is there any option or other customization to keep the outline of
    >> an org buffer (uncollapsed parts of the tree) after the buffer
    >> has been reverted (org-mode 9.0.1, emacs 25.3.2)? In my case only
    >> the top headings are displayed after reverting. This is quite
    >> annoying and time-consuming in a setup, where one constantly
    >> switches between git branches e.g.

    N> Org provides two functions to save and restore visibility (and a
    N> macro that does both, but isn't useful in your case):
    N> `org-outline-overlay-data' and `org-set-outline-overlay-data'.

    N> You may want to use them within `before-revert-hook' and
    N> `after-revert-hook'.

this was spot on, Thanks a lot. The following link

https://stackoverflow.com/questions/6666862/org-mode-go-back-from-sparse-tree-to-previous-visibility/44158824#44158824

had a ready-to-use implementation for this. Excellent, makes life a lot
easier :)

Best,

Roland

-------
http://www.q-leap.com / http://qlustar.com
          --- HPC / Storage / Cloud Linux Cluster OS ---

Reply via email to