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: more than one prefix argument Date: Wed, 27 Jul 2011 08:09:51 -0700 Message-ID: References: <4E2F1C8C.9010802@easy-emacs.de> <4E2F1F1C.2040100@gmail.com> <850340AFD6324E979275501249A9240C@us.oracle.com> <4E2FAF6D.2050905@online.de> <4E2FDC71.5070305@online.de> <4E2FE6AC.8070706@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311779420 10491 80.91.229.12 (27 Jul 2011 15:10:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2011 15:10:20 +0000 (UTC) Cc: 'Daniel Colascione' , emacs-devel@gnu.org To: "=?iso-8859-1?Q?'Andreas_R=F6hler'?=" , "'Tim Cross'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 27 17:10:16 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 1Qm5kV-0001Rm-Ot for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2011 17:10:15 +0200 Original-Received: from localhost ([::1]:42254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm5kQ-00035x-0Z for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2011 11:10:10 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm5kM-00033Z-W5 for emacs-devel@gnu.org; Wed, 27 Jul 2011 11:10:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qm5kH-0007Gr-Lr for emacs-devel@gnu.org; Wed, 27 Jul 2011 11:10:06 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:48299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm5kH-0007GA-A4 for emacs-devel@gnu.org; Wed, 27 Jul 2011 11:10:01 -0400 Original-Received: from rtcsinet21.oracle.com (rtcsinet21.oracle.com [66.248.204.29]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p6RF9vfR021352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Jul 2011 15:09:59 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by rtcsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p6RF9u8J021036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Jul 2011 15:09:57 GMT Original-Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p6RF9o3j012543; Wed, 27 Jul 2011 10:09:50 -0500 Original-Received: from dradamslap1 (/10.159.50.86) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 27 Jul 2011 08:09:50 -0700 X-Mailer: Microsoft Office Outlook 11 x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.6109 In-Reply-To: <4E2FE6AC.8070706@online.de> Thread-Index: AcxMRvsJYmqyrv1ZSzurx45AM65IOwAJdLCQ X-Source-IP: rtcsinet21.oracle.com [66.248.204.29] X-CT-RefId: str=0001.0A090204.4E302A47.0168,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 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:142392 Archived-At: > > Essentially, we would need the raw form. > > why? We need a number or a boolean. > "p" should send a number, 1 as default. > "P" a boolean, nil as default. I answered this, I think. The raw arg provides a way to distinguish in the code pretty much whatever the user did. You can distinguish `C-u C-u' from `C-u 1 6' and `M-1 6', and so on. You cannot distinguish every user prefix-arg action using the raw arg (e.g. `C-u 1 6' and `M-1 6' are indistinguishable), but it is still pretty good. (There are some ways to get the keys that were pressed in order to distinguish them, but they don't have to do with the prefix arg per se.) You might or might not take advantage of this fine-grained distinction in any given command definition. But you can if you want. Your command can let the user use different prefix-arg actions to get different behaviors for the same command. Yes, integers alone would be sufficient to give users an unlimited number of ways to invoke a command. You could distinguish the numeric prefix values 1, 2, 3, 4 (or other) instead of distinguishing, say, nil, plain C-u, zero, and non-zero. And integers alone obviate needing a separate Boolean distinction. And there is not necessarily any _need_ to distinguish user actions such as `M-1 6' vs `C-u C-u'. But other prefix-arg combinations can be handier for users to use or easier to remember. Vive la difference. You have choices when writing a command. If you are confused about "p" and "P" and want to avoid confusion, you can limit yourself to using one or the other. For example, always use just "p" and have your users always distinguish behavior only by number. Nothing wrong with that if that's what you prefer.