[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Keeping outline after reverting buffer
From: |
Roland Fehrenbacher |
Subject: |
Re: [O] Keeping outline after reverting buffer |
Date: |
Sat, 20 Jan 2018 12:38:57 +0100 |
Hi Nicolas,
>>>>> "N" == Nicolas Goaziou <address@hidden> writes:
N> Hello, Roland Fehrenbacher <address@hidden> 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 ---