[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] word count checklist?

From: Eric Schulte
Subject: Re: [Orgmode] word count checklist?
Date: Mon, 26 Jul 2010 16:33:25 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

The following org-mode file uses a Babel code block to return the ratio
of the number of words in the current buffer against the word-goal
variable as a percent.

Note that it doesn't take into account the words used in the code block,
so that may be worth adding to the word-goal, or possibly something
fancier could be done, like pushing the code block out into the Library
of Babel, and adding a grep call to the shell script to remove the
#+call line from the file before passing it to wc.

Best -- Eric

--8<---------------cut here---------------start------------->8---
* return % num-words/word-goal

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.

#+results: word-goal
: 200

#+begin_src sh :var file=(buffer-file-name) :var goal=word-goal
  echo "`wc $file |awk '{print $2}'`00 / $goal"|bc

: 47
--8<---------------cut here---------------end--------------->8---

<address@hidden> writes:

> Hey guys,
> is it possible to to define a number of words and have a
> checklist-type progress-monitor (/ or %) tell you how close
> you are to reaching the number?
> Just curious--it would come in handy...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]