From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Keeping outline after reverting buffer Date: Fri, 19 Jan 2018 18:43:04 +0100 Message-ID: <874lnhpwwn.fsf@nicolasgoaziou.fr> References: <23132.45411.931881.297382@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecah4-0002T8-4G for emacs-orgmode@gnu.org; Fri, 19 Jan 2018 12:43:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecah0-0000mT-VI for emacs-orgmode@gnu.org; Fri, 19 Jan 2018 12:43:10 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:60081) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecah0-0000mB-Ol for emacs-orgmode@gnu.org; Fri, 19 Jan 2018 12:43:06 -0500 In-Reply-To: <23132.45411.931881.297382@gargle.gargle.HOWL> (Roland Fehrenbacher's message of "Mon, 15 Jan 2018 14:49:23 +0100") 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: Roland Fehrenbacher Cc: emacs-orgmode@gnu.org 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. Org provides two functions to save and restore visibility (and a macro that does both, but isn't useful in your case): `org-outline-overlay-data' and `org-set-outline-overlay-data'. You may want to use them within `before-revert-hook' and `after-revert-hook'. Regards, -- Nicolas Goaziou