From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Re: Restore previous folded state of org buffer Date: Mon, 27 Jul 2009 02:50:15 +0800 Message-ID: <87eis3b7o8.fsf@bzg.ath.cx> References: <87hbx0zibp.fsf@bzg.ath.cx> <87vdlge6t2.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MV8nk-0006py-Mk for emacs-orgmode@gnu.org; Sun, 26 Jul 2009 14:50:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MV8ng-0006mn-3P for emacs-orgmode@gnu.org; Sun, 26 Jul 2009 14:50:28 -0400 Received: from [199.232.76.173] (port=57932 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV8nf-0006mZ-UC for emacs-orgmode@gnu.org; Sun, 26 Jul 2009 14:50:23 -0400 Received: from mail-pz0-f202.google.com ([209.85.222.202]:35762) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MV8nf-0008IO-Ep for emacs-orgmode@gnu.org; Sun, 26 Jul 2009 14:50:23 -0400 Received: by pzk40 with SMTP id 40so1766158pzk.14 for ; Sun, 26 Jul 2009 11:50:22 -0700 (PDT) In-Reply-To: (User's message of "Sun, 26 Jul 2009 17:22:27 +0000 (UTC)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: User Cc: emacs-orgmode@gnu.org User writes: > User gmail.com> writes: >> >> The folding information should simply be saved into a separate >> file. For example, for notes.org the accompanying folding >> information could be in notes.org.fold. The posted code can be >> trivially modified to behave this way and with this change the >> actual content of the org file is not affected at all and we have >> a pretty usable folding save/restore extension for org. > > > The thing pestered me, so I fixed it to take care of it. > > Now folding information is saved into a separate file and it is > saved when the buffer is closed (but only if the buffer is saved > to disk to avoid saving folding info for discarded buffers). > > I fixed the algorithm too, because it was buggy. Now it's working > well and it's also simpler. Hey, that's nice. I was just about to suggest: "Why not using a VISIBILITY property for that?" (that would spare us the additional file..) but you were faster than me! :) Thanks for this, -- Bastien