From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Count words under subtrees Date: Tue, 27 Sep 2016 20:52:08 +0200 Message-ID: <877f9xfa5j.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boxUq-00052J-LM for emacs-orgmode@gnu.org; Tue, 27 Sep 2016 14:52:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boxUl-0005IV-FT for emacs-orgmode@gnu.org; Tue, 27 Sep 2016 14:52:51 -0400 Received: from [195.159.176.226] (port=43906 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boxUl-0005DT-7w for emacs-orgmode@gnu.org; Tue, 27 Sep 2016 14:52:47 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1boxUL-000821-5B for emacs-orgmode@gnu.org; Tue, 27 Sep 2016 20:52:21 +0200 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" To: emacs-orgmode@gnu.org Giacomo M writes: Hi, > right now I manually =er/expand-region= (from expand-region.el) until > I select a subtree, and then =count-words-region= to get number of > words for the subtree. I was wondering whether anybody already coded > some lisp to programmatically have this count, ideally one count per > TOC entry (and perhaps excluding headline words in the count). AFAIK there are two libraries that show the "weight" of a folded subtree based on hidden lines as little headline cookies - if that helps. Not sure about their state, they might just work: ,---- | https://github.com/tj64/org-hlc | https://github.com/pinard/org-weights `---- and org-hlc is build into outshine, so if you open (e.g.) an elisp file that is structured with outshine headers (= outcommented org-headers), and have outshine minor-mode enabled, you can use ,----[ C-h f outshine-toggle-hidden-lines-cookies RET ] | outshine-toggle-hidden-lines-cookies is an interactive Lisp function | in `outshine.el'. | | (outshine-toggle-hidden-lines-cookies) | | Toggles status of hidden-lines cookies between shown and hidden. `---- and will see something like this, i.e. folded headers with 'hidden lines cookies': ,---- | 55:;; * Prerequisites | 56:;; ** Start Message and Start Time [#8] | 65:;; ** Setup Parts :mytag: [#79] | 145:;; ** Environment [#92] | 238:;; ** Loading Emacs Lisp Libraries | 239:;; *** Features [#64] | 304:;; *** Library Search [#144] | 449:;; *** Package Manager [#39] | 489:;; *** Autoloads [#5] | 495:;; ** Debugging [#8] | 504:;; * [Screen Input Keys Cmd Enter Exit] [#1] | 506:;; ** 1 (info "(emacs)Screen") [#3] | 510:;; *** 1.1 (info "(emacs)Point") | 511:;; *** 1.2 (info "(emacs)Echo Area") [#4] | 516:;; *** 1.3 (info "(emacs)Mode Line") [#4] | 521:;; *** 1.4 (info "(emacs)Menu Bar") [#2] `---- -- cheers, Thorsten