emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: Re: org-toc.el - browsable table of contents for Org
Date: Tue, 25 Sep 2007 01:06:25 +0200	[thread overview]
Message-ID: <87r6kny87i.fsf@bzg.ath.cx> (raw)
In-Reply-To: <200709241731.13418.zslevin@gmail.com> (Levin's message of "Mon, 24 Sep 2007 17:31:13 +0800")

Levin <zslevin@gmail.com> writes:

> This is very useful. It'll be another org killer tool.

Thanks!  I'm releasing org-toc.el 0.7:

  http://www.cognition.ens.fr/~guerry/u/org-toc.el

I've been thinking quite carefully about your suggestions. 

> 1. Preserve the org buffer tree state when entering org-toc. Currently
> they are all collapsed.

This was intentional. I want to keep Org base buffer and Org TOC
(indirect) buffer as visually distinct as possible. So the default
behavior is to display a table of contents showing the first level
headlines.

You can set `org-toc-default-depth' to another level if you want.

When this variable is set to `nil', Org TOC will display a TOC that is
in the same *global* state of folding, except that it will never show
all the content of the file -- it will show all *branches* instead
(otherwise the TOC wouldn't be a TOC anymore, right?)

> 2. pressing tab in org-toc will not only cyle in org buffer, but also
> in the org-toc buffer (of course, only headlines are shown).

I want the TAB-related keys to cycle through states in the base buffer,
not in the TOC buffer.  So TAB will cycle through the current subtree,
S-TAB will cycle globally, but both will do their job in the base Org
buffer.

To cycle *locally*, use the `:' (org-toc-cycle-subtree) which operates
in the current TOC buffer (and cycle through FOLDED CHILDREN BRANCHES).

> 3. it's very useful for org-toc to keep its state, so next time it is
> called, the toc structure is shown and unchanged. (maybe one org-toc
> per org buffer, and pressing `g' in org-toc to refresh?)

Great idea!  I tried to implement this like that:

`s': store a TOC configuration
`g': jump to that configuration

If the TOC has been modified inbetween, no problem, the configuration
will be back. You can even quit the TOC, work on your document, then
open the TOC again, and fetch the last stored configuration. And this
works for several Org files.  

Hope this suits your needs.

PS: Carsten (and I) would like to find a way to make this TOC buffer
looks visually more distinct than the base buffer. Any suggestion is
most welcome!

PS: Some time ago someone mentionned the need for a way to store the
state of visibility for a buffer. Well, this is not exactly what this
last function provides, but I think it's a first step to it...

-- 
Bastien

  reply	other threads:[~2007-09-24 23:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-23 14:38 org-toc.el - browsable table of contents for Org Bastien
2007-09-24  9:31 ` Levin
2007-09-24 23:06   ` Bastien [this message]
2007-09-26 14:11     ` Renzo Been
2007-09-26 16:06       ` Bastien
2007-09-26 16:22         ` Carsten Dominik
2007-09-29  7:37         ` Renzo Been
2007-09-29 13:21           ` Bastien

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=87r6kny87i.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /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).