emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* word count checklist?
@ 2010-07-26 20:53 scrawler
  2010-07-26 22:33 ` Eric Schulte
  2010-07-27 20:54 ` Andrea Crotti
  0 siblings, 2 replies; 3+ messages in thread
From: scrawler @ 2010-07-26 20:53 UTC (permalink / raw)
  To: Org Mode

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...

-- 

-tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: word count checklist?
  2010-07-26 20:53 word count checklist? scrawler
@ 2010-07-26 22:33 ` Eric Schulte
  2010-07-27 20:54 ` Andrea Crotti
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Schulte @ 2010-07-26 22:33 UTC (permalink / raw)
  To: scrawler; +Cc: Org Mode

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...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: word count checklist?
  2010-07-26 20:53 word count checklist? scrawler
  2010-07-26 22:33 ` Eric Schulte
@ 2010-07-27 20:54 ` Andrea Crotti
  1 sibling, 0 replies; 3+ messages in thread
From: Andrea Crotti @ 2010-07-27 20:54 UTC (permalink / raw)
  To: emacs-orgmode

I feel that maybe a minor mode would be a good choice for this.
You could set a file variable (something like
// -*- compile-command: "gcc -Wall -o dest file" -*-
)
where you set the max and the minor mode with a hook on every key could
update a value in the modeline.

I'm not sure I can do it but I might try if I don't get asleep :D

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-27 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26 20:53 word count checklist? scrawler
2010-07-26 22:33 ` Eric Schulte
2010-07-27 20:54 ` Andrea Crotti

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).