Copyright (C) 2000-2012 |
GNU Info (emacs-lisp-intro.info)Words in a defunCounting Words in a `defun' *************************** Our next project is to count the number of words in a function definition. Clearly, this can be done using some variant of `count-word-region'. Note: Counting Words Counting Words. If we are just going to count the words in one definition, it is easy enough to mark the definition with the `C-M-h' (`mark-defun') command, and then call `count-word-region'. However, I am more ambitious: I want to count the words and symbols in every definition in the Emacs sources and then print a graph that shows how many functions there are of each length: how many contain 40 to 49 words or symbols, how many contain 50 to 59 words or symbols, and so on. I have often been curious how long a typical function is, and this will tell.
automatically generated by info2www version 1.2.2.9 |