[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: count-words-region and count-words-buffer
From: |
Hrvoje Niksic |
Subject: |
Re: count-words-region and count-words-buffer |
Date: |
Wed, 27 Sep 2006 10:08:00 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Robert, please note that the functions in the elisp intro are written
for teaching purposes -- to demonstrate concepts such as recursions
and regexp search and how to debug them. They were meant to be used
by end-users.
That word-counting is easy to implement is true to an extent, but it's
not sufficient argument for omitting such a basic functionality from
Emacs. Also, while it may be easy to implement word-counting in some
form, it's harder to get it right, and harder yet to get it fast for
large buffers. For example, the elisp intro code you cited uses a
regexp search to count words, which is slower than forward-word. The
recursive version would also blow the specpdl-depth limit on large
buffers.