Re: [O] Count words under subtrees

2016-09-28 Thread Adam Porter
Forgive the triple-posting; one of these days I'll learn to wait a bit longer before sharing. Anyway, this updated function will avoid counting the words in drawers and keyword-time lines (e.g. "SCHEDULED:"). Let me know if you find anything else it needs to handle. Skipping source blocks is an

Re: [O] Count words under subtrees

2016-09-28 Thread Adam Porter
You might find this useful as well: #+BEGIN_SRC elisp (defun count-words-in-subtree-or-region () (interactive) (call-interactively (if (region-active-p) 'count-words-region 'count-words-in-subtree))) #+END_SRC I bound that to M-= in

Re: [O] Count words under subtrees

2016-09-28 Thread Adam Porter
I think this should do it: #+BEGIN_SRC elisp (defun count-words-in-subtree () "Count words in current node and child nodes, excluding heading text." (interactive) (save-excursion (save-restriction (widen) (message "%s words" (-sum

Re: [O] Count words under subtrees

2016-09-27 Thread Thorsten Jolitz
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

Re: [O] Count words under subtrees

2016-09-27 Thread Eric S Fraga
On Tuesday, 27 Sep 2016 at 09:01, Giacomo M wrote: > Dear all, > > 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

Re: [O] Count words under subtrees

2016-09-27 Thread Eric S Fraga
And you could always use one of the solutions presented here: https://www.emacswiki.org/emacs/WordCount to have the word count in the mode line. Mark a subtree and automatically see the word count. -- : Eric S Fraga (0xFFFCF67D), Emacs 25.1.50.1, Org release_8.3.6-1149-g582233

[O] Count words under subtrees

2016-09-27 Thread Giacomo M
Dear all, 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