From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Ibuffer: w and B default to buffer at current line Date: Sat, 17 Sep 2016 16:26:34 -0700 (PDT) Message-ID: <4ec39f76-8397-42d4-9422-b75b379dcff5@default> References: > <83intw5our.fsf@gnu.org>> <3dbc0c03-56f9-4b6f-bd3b-258458967665@default> <83zin630i9.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1474154827 15860 195.159.176.226 (17 Sep 2016 23:27:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Sep 2016 23:27:07 +0000 (UTC) Cc: tino.calancha@gmail.com, emacs-devel@gnu.org To: John Wiegley , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 18 01:27:02 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blP0Z-0002sd-3k for ged-emacs-devel@m.gmane.org; Sun, 18 Sep 2016 01:26:55 +0200 Original-Received: from localhost ([::1]:47979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blP0X-0002M9-Cn for ged-emacs-devel@m.gmane.org; Sat, 17 Sep 2016 19:26:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blP0Q-0002Lq-OO for emacs-devel@gnu.org; Sat, 17 Sep 2016 19:26:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blP0P-0005Sr-H2 for emacs-devel@gnu.org; Sat, 17 Sep 2016 19:26:46 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:30342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blP0K-0005Iq-HZ; Sat, 17 Sep 2016 19:26:40 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8HNQb4s028816 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 17 Sep 2016 23:26:37 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u8HNQbXe000952 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 17 Sep 2016 23:26:37 GMT Original-Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u8HNQaoD014346; Sat, 17 Sep 2016 23:26:36 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:207518 Archived-At: > Let me give a hypothetical example: Assume for the sake of argument that > `count-lines' did not report characters as well, and that someone wished > to extend the `count-lines' command so that, given a prefix arg, it would > count characters instead of lines. >=20 > What I think should happen in this case is that a new command be created: > count-items-in-region, which by default counts lines, but with a prefix > argument counts characters. This leaves that command open to many new > behaviors in future, while `count-lines' keeps doing just what it says: > count lines. >=20 > What I would object to is adding a new argument to `count-lines', called > `characters-p', that changes the behavior of count-lines to now count > characters instead (again, remember this is hypothetical, I know that > today's `count-lines' already counts characters as well). Seems like you're confusing a few things. Is your point about the evolution of an existing function? You don't want to affect the longtime behavior of an existing function? Or is it about having a single function (`count-items-in-region'), from the outset, that can count different things depending on the=20 presence/value of an optional argument CHARACTERS-P or ITEM-TYPE? Is it the multiple behaviors that bother you, or the fact that some existing function is being changed/affected? > I believe -- very strongly -- that each function should do > one thing and one thing well, Define "one thing". Does `mapc' do one thing: map a function over a list; or does it do any number of things, depending on its function argument (and its list argument, for that matter). Is your argument limited to behavior from &optional arguments, or does it apply also to required args too (e.g. the FUNCTION arg of `mapc'). Does it make a difference in your understanding of "do one thing" whether `count-items-in-region' takes a required CHARACTERS-P or ITEM-TYPE arg or that arg is optional? > and this one thing should be documented well. I don't like > magical functions with lots of alternative behaviors, What constitutes "magical", for you? How many alternative behaviors is "lots", for you? Yes, it would annoy me too if I had to try to answer such questions. ;-) But that's the cost of such generalizing, I think. Better to discuss such things in specific, concrete cases. That keeps arguments a bit more grounded.