[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rethinking count-words-region

From: Chong Yidong
Subject: Rethinking count-words-region
Date: Fri, 07 Oct 2011 11:41:42 -0400

The command `count-words-region', newly introduced for Emacs 24, is
inconsistent with the pre-existing `count-lines-region'.  If no region
is active, the former reports the number of words in the buffer
(implemented in Bug#9429).  The latter always reports the number of
lines in the region, whether or not it is active.

The two ought to be consistent.  The behavior of `count-words-region' is
the better one, I think, even if adopting it incurs some backward

But going beyond this, instead of introducing a separate
`count-words-region' command, why not fold this functionality into
`count-lines-region'?  After all, `count-lines-region' already reports
the number of characters, and there's space for it to report the number
of words too.  And it has a convenient binding in M-=, whereas
`count-words-region' has no default binding.

Maybe we could rename the combined function something like `count-text'
(better suggestions welcome).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]