Is this thing on?

Word Count Mode

Word Count Mode

There is a fun little journaling website called 750words that encourages writing at 750 words at a time. I think the idea is great, but I do not want my writing in the cloud. So, I created wc-mode.

It is a little mode that provides a word/line/character count in the modeline. The mode captures the changes in the buffer and present them to you, the user.

Additionally, wc-mode lets you define goals for content and alerts you (via the modeline) when you reach that goal.

Installation

To install, grab it from Github or use one of the following commands.

 ?> git clone git://github.com/bnbeckwith/wc-mode.git
 ?> git clone http://github.com/bnbeckwith/wc-mode.git

Use the following code to add it to emacs.

  ;; Supply the path to the mode repository
  (add-to-list 'load-path "location/of/wc-mode")
  (require 'wc-mode)
  ;; (Optionally) setup a global key
  (global-set-key "\C-cw" 'wc-mode)

When you want to check your added words or set goals, turn on the mode with your global key.

Usage

There are two different ways to use this packge. First, you can use it as a minor mode (preferred method). But, if you do not want the full power of a mode, you can just call the wc-count function which will show a message of the current words, lines and characters in the current buffer.

The rest of this section focuses on the minor-mode usage.

Keystrokes

After enbling wc-mode, a small set of commands are avaialbe via the follwoing keymap.

KeyFunction
C-c C-w wSet word goal
C-c C-w lSet line goal
C-c C-w aSet character goal
C-c C-w cDo a ‘wc’ on the buffer

The first three keys set specific goals. The modeline displayed will highlight when upon goal completion. These goals are in relation to the delta of what is already on the page. Because of that, you are free to set a negative goal – useful for text that needs editing.

The final key just runs the wc-count function to get a message in the mini-buffer.

Modeline

The modeline format string, wc-modeline-format describes how to display the pieces of data. The following table defines the format-codes used.

Format CodeWhat is displayed
%WOriginal word count (before changes)
%LOriginal line count
%COriginal character count
%wChange in words
%lChange in lines
%cChange in characters
%gcCharacter change goal
%glLine change goal
%gwWord change goal
%twTotal words in buffer
%tlTotal lines in buffer
%tcTotal characters in buffer

The default setting is “WC[%W%w/%tw]“. This displays a “WC[” followed by the original word count, then the change in word count, followed by a slash and the total number of words in the buffer.



From the Blog

Here are the latest items from the blog. Hopefully there is something interesting to show.

Bookmarks for January 10th through March 12th

Interesting links links for January 10th through March 12th:

Low Sodium Recipe Archive – Recipes for my dad. Amazon.com: Prime Eligible – Kindle Edition:...
Bookmarks for September 14th through October 18th

Interesting links links for September 14th through October 18th:

QuantumLevitation « adafruit industries blog – Floating discs are cool Cool tech demo: match 3D...