help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Rationale behind conversion of a nil prefix arg to numeric 1


From: Eli Zaretskii
Subject: Re: Rationale behind conversion of a nil prefix arg to numeric 1
Date: Sun, 04 Sep 2016 21:33:49 +0300

> From: Andreas Röhler <address@hidden>
> Date: Sun, 4 Sep 2016 19:11:31 +0200
> 
> >> I am still wondering about the
> >> rationale of representing nil as the number one. Does this make sense,
> >> or is it useful, in some way?
> > Yes.  Most commands use the argument as a repeat count, so having it
> > default to one makes perfect sense.
> >
> 
> There a difference between "p" sending 1 and nil - which is the result 
> from non-interactive use.

"p" is documented as the _numeric_ value of the argument.  So it
obviously cannot yield nil.

> If a function needs a repeat count, it should provide some.

That'd mean changes in 90% of commands.  Quite silly, I'd say.

In any case, the OP asked what was the rationale, and I tried to
answer that.  Whether or not Emacs should have been designed
differently is another argument for another rainy day.



reply via email to

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