From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanle Song Subject: Re: How to preverse fold status after reopening a file Date: Wed, 27 May 2009 03:39:06 -0500 Message-ID: <20090527083905.GA2652@sylecn> References: <20090527021947.GA25775@sylecn> <87zlcz6ux4.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9EfT-0002em-L2 for emacs-orgmode@gnu.org; Wed, 27 May 2009 04:39:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9EfO-0002dy-LU for emacs-orgmode@gnu.org; Wed, 27 May 2009 04:39:22 -0400 Received: from [199.232.76.173] (port=49775 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9EfO-0002du-H0 for emacs-orgmode@gnu.org; Wed, 27 May 2009 04:39:18 -0400 Received: from yw-out-1718.google.com ([74.125.46.156]:11064) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9EfN-0002JW-Rj for emacs-orgmode@gnu.org; Wed, 27 May 2009 04:39:18 -0400 Received: by yw-out-1718.google.com with SMTP id 5so2386833ywm.66 for ; Wed, 27 May 2009 01:39:17 -0700 (PDT) Received: from sylecn by sylecn.sylecn with local (Exim 4.69) (envelope-from ) id 1M9EfC-0000hs-3R for emacs-orgmode@gnu.org; Wed, 27 May 2009 03:39:06 -0500 Content-Disposition: inline In-Reply-To: <87zlcz6ux4.fsf@fastmail.fm> 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: emacs-orgmode mailing list On Tue, May 26, 2009 at 11:17:59PM -0500, Matthew Lundin wrote: > Hi Yuanle, > > Yuanle Song writes: > > > org-mode can show a file in following mode when opening a file: > > > > overview top-level headlines only > > content all headlines > > showall no folding at all, show everything > > > > But they don't feed my need. I want to have the file exactly the same > > as last time I open it, i.e. if a headline is fold when closing it > > will be fold after reopening. > > My guess is that this would require a lot of overhead to implement in a > plain text system like org. > I'm thinking whether there is another approach. I mean do it without modifying org-mode codes. I don't know whether someone here is using emacs desktop or session with org-mode files. They restore a lot of things when you restart emacs. Does these kind of tools work for my purpose? If the information needed to restore the file view can be saved to disk, and then reload when emacs starts, I get back the old view. I don't know how org-mode works, if it is using mostly emacs data structures, there is a possibility that they can be easily saved and reload. Just like how savehist and saveplace works. I might be wrong because I really don't know that the details about emacs lisp. Any suggestions or comments? > > If that's not possible. Is there any properties that I can apply to > > one headline, that will keep the headline fold (or unfold) unless the > > user press TAB on them? > > I believe the following passage from the manual (2.3) will be of > interest: > > ,---- > | Furthermore, any entries with a ‘VISIBILITY’ property (see Properties > | and Columns) will get their visibility adapted accordingly. Allowed > | values for this property are folded, children, content, and all. > `---- This is part of what I'm looking for. Thanks for bring it up. > > http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling > > Regards, > > Matt