From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: org-toc.el - browsable table of contents for Org Date: Tue, 25 Sep 2007 01:06:25 +0200 Message-ID: <87r6kny87i.fsf@bzg.ath.cx> References: <87hclla1lb.fsf@bzg.ath.cx> <200709241731.13418.zslevin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZx0c-0004sA-P8 for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 19:06:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZx0c-0004ry-40 for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 19:06:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZx0c-0004rv-0D for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 19:06:34 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IZx0b-0005AW-IQ for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 19:06:33 -0400 Received: by nf-out-0910.google.com with SMTP id f5so1357226nfh for ; Mon, 24 Sep 2007 16:06:32 -0700 (PDT) In-Reply-To: <200709241731.13418.zslevin@gmail.com> (Levin's message of "Mon, 24 Sep 2007 17:31:13 +0800") 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@gnu.org Levin 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