emacs 24 command: count-words

in emacs 24, a frequently asked command is finally here: “count-words”.

this command will count {lines, words, characters} of the current file. If there is a text selection, then it'll count in that region only.

if you are using emacs 23.x, you can define the command yourself. Like this:

(defun count-word-region-or-buffer ()
  (message "Word count: %s" (how-many "\\w+")))

Thanks to Jon Snader (jcs) for this nice implementation.

For a detailed elisp tutorial, see: See: Emacs Lisp: Count Lines, Words, Chars.

See also: Try Out Emacs 24 Alpha Release

Popular posts from this blog

11 Years of Writing About Emacs

does md5 creates more randomness?

Google Code shutting down, future of ErgoEmacs