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
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 or
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 (org-map-ent
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 c
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 prog
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
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 entry