From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: keep|flush-lines, how-many to be used backward. Date: Fri, 28 Sep 2007 08:50:33 -0700 Message-ID: References: <87lkardtk8.fsf@cadilhac.name> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1190994686 5753 80.91.229.12 (28 Sep 2007 15:51:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 28 Sep 2007 15:51:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?=22Micha=EBl=22_Cadilhac?= , "Juri Linkov" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 28 17:51:22 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IbI7N-0000Hk-U4 for ged-emacs-devel@m.gmane.org; Fri, 28 Sep 2007 17:51:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbI7K-0001gq-0Z for ged-emacs-devel@m.gmane.org; Fri, 28 Sep 2007 11:51:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IbI7D-0001cZ-5o for emacs-devel@gnu.org; Fri, 28 Sep 2007 11:50:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IbI79-0001ab-MU for emacs-devel@gnu.org; Fri, 28 Sep 2007 11:50:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IbI78-0001aL-U9 for emacs-devel@gnu.org; Fri, 28 Sep 2007 11:50:51 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IbI78-0000Sy-EH for emacs-devel@gnu.org; Fri, 28 Sep 2007 11:50:50 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l8SFoYjp016016; Fri, 28 Sep 2007 09:50:34 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l8SEDbVn025744; Fri, 28 Sep 2007 09:50:34 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-74-29.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3252633141190994627; Fri, 28 Sep 2007 08:50:27 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <87lkardtk8.fsf@cadilhac.name> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-MIME-Autoconverted: from 8bit to quoted-printable by rgminet01.oracle.com id l8SFoYjp016016 X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:79998 Archived-At: > To sum up, I think the prefix argument has only two use cases=A0: > - As a boolean (present/absent), > - As a number. > > Wanting to mix those two is, to me, a hack. > > If we're going to camp on our positions=A0:-) does someone else have an > opinion=A0? Yes (since you asked), FWIW, and without reference to the specific prefix-arg use in this thread - A raw prefix arg can have different kinds of values (nil, consp, integer (negative, zero, positive)), and the numeric values of these different ra= w values can also be used. Functions should be free to use any of these val= ues (both raw and numeric) as they like. There should be no limits or conventions that restrict this. However, functions that interpret a prefix arg owe it to their users to clearly explain the behavior of the prefix arg in the doc string. As long= as that is done, I see no problem. However #2: Other things being equal, there are some common use patterns that can be followed (can be, not need to be), and that can make life eas= ier for users: * positive numeric arg N means repeat N times * -N means reverse the "direction" of N, whatever "direction" might mean = in a particular context. * the default behavior (without any explicit prefix arg) should be the behavior that users will use most In sum: 1. No strict convention or standard meaning that limits what you do with = a function you define. 2. If there is no reason not to, you might want to follow some common use patterns, interpreting them as appropriate in your context. 3. Document all prefix-arg behavior clearly in the doc string. A prefix arg is a useful way to multiply the functionality of a single function, typically a command that is bound to a key. Programmers should = not feel limited in any way in the use they make of prefix args. Explore, experiment, do what you want with it; it's just a tool. If you want to ma= ke things easier on users, however, and if there is no reason not to, then y= ou might want to follow some informal conventions - it's up to you. Just my opinion, of course.