From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Piotr Zielinski" Subject: Re: Autocollapse of outline nodes Date: Wed, 26 Apr 2006 13:44:56 +0100 Message-ID: <3c12eb8d0604260544i6a1fdb91r25c7f1e08308a315@mail.gmail.com> References: <3c12eb8d0604240515l3313b552o2ba25db2e7012f97@mail.gmail.com> <39e6a980b34a61ebb4e57f452699359c@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYjO8-0007ko-TN for emacs-orgmode@gnu.org; Wed, 26 Apr 2006 08:45:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYjO7-0007jZ-7W for emacs-orgmode@gnu.org; Wed, 26 Apr 2006 08:45:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYjO7-0007jV-1C for emacs-orgmode@gnu.org; Wed, 26 Apr 2006 08:44:59 -0400 Received: from [64.233.162.192] (helo=nz-out-0102.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYjQn-0007AY-EA for emacs-orgmode@gnu.org; Wed, 26 Apr 2006 08:47:45 -0400 Received: by nz-out-0102.google.com with SMTP id 14so1565127nzn for ; Wed, 26 Apr 2006 05:44:58 -0700 (PDT) In-Reply-To: <39e6a980b34a61ebb4e57f452699359c@science.uva.nl> Content-Disposition: inline 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: Carsten Dominik Cc: emacs-orgmode@gnu.org Carsten, thanks for your comments. I'll incorporate your suggestions into the code as soon as I can. Piotr On 26/04/06, Carsten Dominik wrote: > > On Apr 24, 2006, at 14:15, Piotr Zielinski wrote: > > > Hi, > > > > Here's a small piece of code that periodically collapses all org nodes > > (trees) which are far away (structurally) from the current cursor > > position. The purpose is to automatically collapse nodes which you > > are no longer working on, thereby preventing uncontrolled growth of > > the visible size of your .org buffer as the day progresses. > > very interesting idea / piece of code. > > One potential problem that I see is that (point) is a property of a > window. Only if a buffer is shown in one or zero windows, then (point) > is unique after a set-buffer operation for this buffer and you can use > it to select which part not to hide. > > So what might happen is that you can have two or more windows on a > buffer (in the same frame, or even on different frames), each looking > at a different section of the outline tree. I often do this when > restructuring a file, while moving stuff from one place in a file to > another. Your code would keep closing some of the visible outlines, > because it only considers (point) in a single window (I don't even know > which one if would actually use in this case, an interesting problem). > To solve this, you would need to check if a buffer is displayed in > several places, make a list of (point) in all these places, and then > check is any of the listed values of point fall in the outline subtree > you are about to close. > > Finally, you are running it on an idle timer with 60 seconds of idle > time required. I would be interesting how this works in pratice, and > if this is the best way to activate this code. For now, I have not > tried it extensively and I don't know. > > - Carsten > > > > -- > Carsten Dominik > Sterrenkundig Instituut "Anton Pannekoek" > Universiteit van Amsterdam > Kruislaan 403 > NL-1098SJ Amsterdam > phone: +31 20 525 7477 > >