emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] org-toc.el - browsable table of contents for Org


From: Bastien
Subject: Re: [Orgmode] org-toc.el - browsable table of contents for Org
Date: Tue, 25 Sep 2007 01:06:25 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux)

Levin <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]