From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Fehrenbacher Subject: Re: Keeping outline after reverting buffer Date: Sat, 20 Jan 2018 12:38:57 +0100 Message-ID: <23139.10833.341343.841675@gargle.gargle.HOWL> References: <23132.45411.931881.297382@gargle.gargle.HOWL> <874lnhpwwn.fsf@nicolasgoaziou.fr> Reply-To: rf@q-leap.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecrUS-00041i-RD for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 06:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecrUP-0004XY-ID for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 06:39:16 -0500 Received: from ns-2.q-leap.de ([46.237.196.33]:39542 helo=mail.q-leap.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecrUP-0004Uw-AV for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 06:39:13 -0500 In-Reply-To: <874lnhpwwn.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hi Nicolas, >>>>> "N" == Nicolas Goaziou writes: N> Hello, Roland Fehrenbacher 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 ---