From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.devel Subject: Re: more than one prefix argument Date: Wed, 27 Jul 2011 11:37:53 +0200 Message-ID: <4E2FDC71.5070305@online.de> References: <4E2F1C8C.9010802@easy-emacs.de> <4E2F1F1C.2040100@gmail.com> <850340AFD6324E979275501249A9240C@us.oracle.com> <4E2FAF6D.2050905@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311759487 12091 80.91.229.12 (27 Jul 2011 09:38:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2011 09:38:07 +0000 (UTC) Cc: Daniel Colascione , Drew Adams , emacs-devel@gnu.org To: Tim Cross Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 27 11:38:03 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 1Qm0Yz-0001ka-Qo for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2011 11:38:02 +0200 Original-Received: from localhost ([::1]:38017 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0Yz-0002PH-6p for ged-emacs-devel@m.gmane.org; Wed, 27 Jul 2011 05:38:01 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0Yv-0002P0-K8 for emacs-devel@gnu.org; Wed, 27 Jul 2011 05:37:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qm0Yu-0003Zy-NE for emacs-devel@gnu.org; Wed, 27 Jul 2011 05:37:57 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:49823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm0Yu-0003Zm-A8 for emacs-devel@gnu.org; Wed, 27 Jul 2011 05:37:56 -0400 Original-Received: from [192.168.178.27] (brln-4dbc767f.pool.mediaWays.net [77.188.118.127]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0LxHby-1RVSZ61GBO-0170ao; Wed, 27 Jul 2011 11:37:54 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11 In-Reply-To: X-Provags-ID: V02:K0:FgG9YWbE3wpBxhIllCdL3cMov0TeYlK65P14iSEte0R uaeMFDp5ivtXPT0IPYI9r82oEKDy80xv5FNJSKWCdmk3CZLQDr crtDYXHxDML3vcC7gbe4iZ1MI++bs3wAI75vVyX+uFwF+PRMyQ 58dXCrRlPmquab+QuVIaVw70jw+RM8uYVI2jQEX7UCCwnidApE fu0rgSMz8uoFG0CvVmNwr29PzIWZ3o8wQ3M6vsXUGM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.186 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:142365 Archived-At: 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? without 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" would likely make the reading of the source even > more difficult than your example issue with the use of '4' in your > example. I would also suggest that if you don't like the literal 4 as > it doesn't make it clear what is going on (why 4?) you could define a > variable, such as >