From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Restore previous folded state of org buffer Date: Sun, 26 Jul 2009 06:28:25 +0800 Message-ID: <87vdlge6t2.fsf@bzg.ath.cx> References: <87hbx0zibp.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 1MUpjL-0001zO-1y for emacs-orgmode@gnu.org; Sat, 25 Jul 2009 18:28:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUpjF-0001z8-K5 for emacs-orgmode@gnu.org; Sat, 25 Jul 2009 18:28:37 -0400 Received: from [199.232.76.173] (port=45793 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUpjF-0001z5-EN for emacs-orgmode@gnu.org; Sat, 25 Jul 2009 18:28:33 -0400 Received: from rv-out-0708.google.com ([209.85.198.251]:47505) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MUpjF-0002HU-3I for emacs-orgmode@gnu.org; Sat, 25 Jul 2009 18:28:33 -0400 Received: by rv-out-0708.google.com with SMTP id f25so980936rvb.6 for ; Sat, 25 Jul 2009 15:28:32 -0700 (PDT) In-Reply-To: (User's message of "Sat, 25 Jul 2009 19:34:01 +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: > I don't need this feature at the moment, but the problem > intrigued me, so I came up with a quick implementation. Great! > I don't plan to work on it further, since I don't really need it > yet (I'm a novice org user), but I put it here if someone wants > to develop the idea. > > You simply load the elisp file and from that on folding state is > automatically saved and restored for org mode files. The folding > information is saved at the end of the org file itself every time > the buffer is saved. > > It seemed to work pretty well. The only faulty case I discovered > is when the very last branch is folded in the file, because it > contains the saved folding info, but this bug is probably easy to > fix with a little thinking. Yes, I found this bug. One way to work around this limitation and to safely store the folding information would be to put it in a face property for each headline. Perhaps you have time to dig into that direction? Thanks for this proof-of-concept! -- Bastien