emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Piotr Zielinski <piotr.zielinski@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Autocollapse of outline nodes
Date: Wed, 26 Apr 2006 11:20:15 +0200	[thread overview]
Message-ID: <39e6a980b34a61ebb4e57f452699359c@science.uva.nl> (raw)
In-Reply-To: <3c12eb8d0604240515l3313b552o2ba25db2e7012f97@mail.gmail.com>


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

  parent reply	other threads:[~2006-04-26  9:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24 12:15 Autocollapse of outline nodes Piotr Zielinski
2006-04-24 16:08 ` Xavier Maillard
2006-04-26  9:20 ` Carsten Dominik [this message]
2006-04-26 12:44   ` Piotr Zielinski
2006-05-12  1:26   ` Piotr Zielinski
2006-05-12  4:35     ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39e6a980b34a61ebb4e57f452699359c@science.uva.nl \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=piotr.zielinski@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).