From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: more than one prefix argument Date: Wed, 27 Jul 2011 19:48:19 +1000 Message-ID: References: <4E2F1C8C.9010802@easy-emacs.de> <4E2F1F1C.2040100@gmail.com> <850340AFD6324E979275501249A9240C@us.oracle.com> <4E2FAF6D.2050905@online.de> <4E2FDC71.5070305@online.de> 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: dough.gmane.org 1311760108 16014 80.91.229.12 (27 Jul 2011 09:48:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2011 09:48:28 +0000 (UTC) Cc: Daniel Colascione , Drew Adams , emacs-devel@gnu.org To: =?ISO-8859-1?Q?Andreas_R=F6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 27 11:48:24 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 1Qm0j2-0005Do-38 for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2011 11:48:24 +0200 Original-Received: from localhost ([::1]:33243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0j1-0006ao-IP for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2011 05:48:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0iz-0006aW-IS for emacs-devel@gnu.org; Wed, 27 Jul 2011 05:48:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qm0iy-0005kc-II for emacs-devel@gnu.org; Wed, 27 Jul 2011 05:48:21 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:36025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0iy-0005kY-Cv for emacs-devel@gnu.org; Wed, 27 Jul 2011 05:48:20 -0400 Original-Received: by iyb14 with SMTP id 14so1999857iyb.0 for ; Wed, 27 Jul 2011 02:48:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=8f/ZvG4uyJ1yaxQunyK/Ze9fJjx/Qlfuhm46pv6vmu0=; b=aMsOfyH4nLGWmbTiV28N27hi9me2Cfwbc0YGk259dPk2+8uwO6vpS8KP99ZyWiFsl2 Pl1IeB8rxt/YZK6TsITuAS4XGstK2+lls1Qm4bfy0PbWQeC7J1kVjYD3MhLGbQlP+wRI skuFzq6xLFY4DNWUSxaF+N7bUM78Ms0lrg70s= Original-Received: by 10.231.193.137 with SMTP id du9mr6752860ibb.136.1311760099324; Wed, 27 Jul 2011 02:48:19 -0700 (PDT) Original-Received: by 10.231.37.76 with HTTP; Wed, 27 Jul 2011 02:48:19 -0700 (PDT) In-Reply-To: <4E2FDC71.5070305@online.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 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:142369 Archived-At: On Wed, Jul 27, 2011 at 7:37 PM, Andreas R=F6hler wrote: > Am 27.07.2011 11:25, schrieb Tim Cross: > [ ... ] >> >> While P and p are similar, I'm not sure they are as similar as you >> imply. Consider a very simple example. You have a function and you >> want it to use a prefix arg and you want the raw form because you want >> to distinguish between no prefix arg and C-u 1 or M-1. You then define >> a second function, but this time, you want it to default to 1 if no >> prefix arg or whatever the value is if one is provided, then the 'p' >> numeric version is what you want. In each case, the P and p support >> what you need > > yes, but one of them would be sufficient. > > OTOH we have not a handy code for branching. > > Do you know case, "p" receiving M- numeric arg must fail, so C-u NUMBER > through "P" is needed? > > > =A0without you having to do additional code. Yes, you could >> >> solve this with just the P version, but then you would have to do more >> code to handle the common case of just wanting to process the prefix >> arg as a number. >> >> This additional code > > Don't suggest additional code but a better use of "P" - no parallel > implementations. Having "P" as a branch-flag not affected by "p" > Sorry, just not quite following your argument. If we were to get rid of one, it would have to be the numeric version (i.e. p) rather than P as sometimes you need to be able to distinguish between nil and 1. Essentially, we would need the raw form. This means that whenever you need to process the prefix argument as a number you will need to test and convert it to distinguish nil and extract the value from the list - this would be additional code ini your function. I don't understand what you mean by having a handy code for branching. Can you give an example of how this code would work and how a command using this code would be called? tim