From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: viewing number of nested headlines Date: Tue, 05 Feb 2013 22:03:15 +0100 Message-ID: <87zjziv5gs.fsf@bzg.ath.cx> References: <87y5f3vycq.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2pfl-0007or-R3 for emacs-orgmode@gnu.org; Tue, 05 Feb 2013 16:03:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2pfk-0008U1-P1 for emacs-orgmode@gnu.org; Tue, 05 Feb 2013 16:03:21 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:50272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2pfk-0008Tt-IV for emacs-orgmode@gnu.org; Tue, 05 Feb 2013 16:03:20 -0500 Received: by mail-wg0-f50.google.com with SMTP id es5so524569wgb.29 for ; Tue, 05 Feb 2013 13:03:19 -0800 (PST) In-Reply-To: (42's message of "Tue, 5 Feb 2013 15:17:17 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: 42 147 Cc: Org Mode Hi 42 (what's your other name?) 42 147 writes: > Maybe you could point me in the right direction; somewhere in the > code, org-mode must be aware of the number of nested headlines in > order for show-branches and show-children to work. Or maybe it is > not. It is not. Long story short: folding a headline works by adding a text overlay with the invisible property, and finding the end of the overlay works by finding another headline of the same level. So there is no nothing of "jumping" by N subtrees. Still, you can fetch the number of invisible headline in a folded subtree *afterwards* -- I assumed this is what François' code does. > In any case, I'd try and adapt the code to display a number > indicating (1) position in the hierarchy; and (2) number of > headlines at that / those position(s). This could end up in a minor mode or simply a feature that people could turn on and off. But beware of the efficiency: with many headlines, the folding features of Org combined with this feature could become quite slow. > Apologies if the original message was poorly articulated. No problem, that's part of the game. Thanks, -- Bastien