[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more than one prefix argument

From: Andreas Röhler
Subject: Re: more than one prefix argument
Date: Wed, 27 Jul 2011 11:37:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv: Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]