From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Rethinking count-words-region Date: Fri, 07 Oct 2011 11:41:42 -0400 Message-ID: <87vcs0q05l.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1318002118 18953 80.91.229.12 (7 Oct 2011 15:41:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 Oct 2011 15:41:58 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 07 17:41:54 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RCCYb-0005Az-Sq for ged-emacs-devel@m.gmane.org; Fri, 07 Oct 2011 17:41:54 +0200 Original-Received: from localhost ([::1]:59668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCCYb-00017p-5d for ged-emacs-devel@m.gmane.org; Fri, 07 Oct 2011 11:41:53 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCCYX-00017V-B5 for emacs-devel@gnu.org; Fri, 07 Oct 2011 11:41:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RCCYS-0007dS-OL for emacs-devel@gnu.org; Fri, 07 Oct 2011 11:41:49 -0400 Original-Received: from vm-emlprdomr-02.its.yale.edu ([130.132.50.143]:58875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCCYS-0007dI-MP for emacs-devel@gnu.org; Fri, 07 Oct 2011 11:41:44 -0400 Original-Received: from furball (dhcp-128-36-59-9.central.yale.edu [128.36.59.9]) (authenticated bits=0) by vm-emlprdomr-02.its.yale.edu (8.14.4/8.14.4) with ESMTP id p97FfhCk030596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Fri, 7 Oct 2011 11:41:43 -0400 X-Scanned-By: MIMEDefang 2.71 on 130.132.50.143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.132.50.143 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:144700 Archived-At: 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 incompatibility. 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).