From: "Eric Schulte" <schulte.eric@gmail.com>
To: scrawler@gmail.com
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: word count checklist?
Date: Mon, 26 Jul 2010 16:33:25 -0600 [thread overview]
Message-ID: <87y6cxdgay.fsf@gmail.com> (raw)
In-Reply-To: <20100726155303.124c6396@bigblessing.tville> (scrawler@gmail.com's message of "Mon, 26 Jul 2010 15:53:03 -0500")
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
#+end_src
#+results:
: 47
--8<---------------cut here---------------end--------------->8---
<scrawler@gmail.com> 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...
next prev parent reply other threads:[~2010-07-26 22:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 20:53 word count checklist? scrawler
2010-07-26 22:33 ` Eric Schulte [this message]
2010-07-27 20:54 ` Andrea Crotti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y6cxdgay.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=scrawler@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.