* bug#24369: Docu of prefix-numeric-value
@ 2016-09-05 7:52 Andreas Röhler
2016-09-05 15:57 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2016-09-05 7:52 UTC (permalink / raw)
To: 24369
See recent question at
http://lists.gnu.org/archive/html/help-gnu-emacs/2016-09/msg00018.html
Please add some explanation WRT treatment of the nil-argument.
Also WRT C-u
Thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 7:52 bug#24369: Docu of prefix-numeric-value Andreas Röhler
@ 2016-09-05 15:57 ` Drew Adams
2016-09-05 17:44 ` Andreas Röhler
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2016-09-05 15:57 UTC (permalink / raw)
To: Andreas Röhler, 24369
> See recent question at
> http://lists.gnu.org/archive/html/help-gnu-emacs/2016-09/msg00018.html
>
> Please add some explanation WRT treatment of the nil-argument.
> Also WRT C-u
What "treatment" are you asking to be explained?
Just what do you think is missing?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 15:57 ` Drew Adams
@ 2016-09-05 17:44 ` Andreas Röhler
2016-09-05 17:46 ` Drew Adams
2016-09-05 17:57 ` Eli Zaretskii
0 siblings, 2 replies; 9+ messages in thread
From: Andreas Röhler @ 2016-09-05 17:44 UTC (permalink / raw)
To: Drew Adams, 24369
On 05.09.2016 17:57, Drew Adams wrote:
>> See recent question at
>> http://lists.gnu.org/archive/html/help-gnu-emacs/2016-09/msg00018.html
>>
>> Please add some explanation WRT treatment of the nil-argument.
>> Also WRT C-u
> What "treatment" are you asking to be explained?
> Just what do you think is missing?
Elisp Info 20.2.2 Code Characters for ‘interactive’
----------------------------------------
p’
The numeric prefix argument
User will expect the argument received by function being consistent with
input, i.e. M-x 2 foo... sends 2, M-x 1 foo ... sends 1. From there
omitting an argument will be expected to send nothing - which isn't the
case.
Likewise with uppecase P.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 17:44 ` Andreas Röhler
@ 2016-09-05 17:46 ` Drew Adams
2016-09-05 17:57 ` Eli Zaretskii
1 sibling, 0 replies; 9+ messages in thread
From: Drew Adams @ 2016-09-05 17:46 UTC (permalink / raw)
To: Andreas Röhler, 24369
> > What "treatment" are you asking to be explained?
> > Just what do you think is missing?
>
> Elisp Info 20.2.2 Code Characters for ‘interactive’
> ----------------------------------------
>
> p The numeric prefix argument
>
> Likewise with uppecase P.
Again, what do you think is missing? `p' is the numeric prefix argument.
`P' is the raw prefix argument.
This is not the Elisp manual node that describes WHAT these things
are. But there is a link here to the node that does that, node
`Prefix Command Arguments'
http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html
And that's the case even in the Emacs 20 version of the manual,
which you cited.
> User will expect the argument received by function being consistent with
> input, i.e. M-x 2 foo... sends 2, M-x 1 foo ... sends 1. From there
> omitting an argument will be expected to send nothing - which isn't the
> case.
Why on Earth would the user expect that, simply from reading that
`interactive' code `p' returns the numeric prefix argument and `P'
returns the raw prefix argument?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 17:44 ` Andreas Röhler
2016-09-05 17:46 ` Drew Adams
@ 2016-09-05 17:57 ` Eli Zaretskii
2016-09-05 18:33 ` Andreas Röhler
1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2016-09-05 17:57 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 24369
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Date: Mon, 5 Sep 2016 19:44:28 +0200
>
> >> Please add some explanation WRT treatment of the nil-argument.
> >> Also WRT C-u
> > What "treatment" are you asking to be explained?
> > Just what do you think is missing?
>
> Elisp Info 20.2.2 Code Characters for ‘interactive’
> ----------------------------------------
>
> p’
> The numeric prefix argument
>
> User will expect the argument received by function being consistent with
> input, i.e. M-x 2 foo... sends 2, M-x 1 foo ... sends 1. From there
> omitting an argument will be expected to send nothing - which isn't the
> case.
There's more in the manual than just that one paragraph.
ELisp manual 20.12 Prefix Command Arguments:
-------------------------------------------
There are two representations of the prefix argument: “raw” and
“numeric”. The editor command loop uses the raw representation
internally, and so do the Lisp variables that store the information, but
commands can request either representation.
Here are the possible values of a raw prefix argument:
• ‘nil’, meaning there is no prefix argument. Its numeric value is
1, but numerous commands make a distinction between ‘nil’ and the
integer 1.
...
-- Function: prefix-numeric-value arg
This function returns the numeric meaning of a valid raw prefix
argument value, ARG. The argument may be a symbol, a number, or a
list. If it is ‘nil’, the value 1 is returned; if it is ‘-’, the
value −1 is returned; if it is a number, that number is returned;
if it is a list, the CAR of that list (which should be a number) is
returned.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 17:57 ` Eli Zaretskii
@ 2016-09-05 18:33 ` Andreas Röhler
2016-09-05 18:57 ` Eli Zaretskii
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2016-09-05 18:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 24369
On 05.09.2016 19:57, Eli Zaretskii wrote:
>
> Here are the possible values of a raw prefix argument:
>
> • ‘nil’, meaning there is no prefix argument. Its numeric value is
> 1,
That's the point:
Value of nil is 1
Value of 1 is 1
But he value of 2 is 2
Consistency means something different.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 18:33 ` Andreas Röhler
@ 2016-09-05 18:57 ` Eli Zaretskii
2016-09-05 21:03 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2016-09-05 18:57 UTC (permalink / raw)
To: Andreas Röhler; +Cc: 24369
> Cc: drew.adams@oracle.com, 24369@debbugs.gnu.org
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Date: Mon, 5 Sep 2016 20:33:21 +0200
>
> > • ‘nil’, meaning there is no prefix argument. Its numeric value is
> > 1,
>
> That's the point:
>
> Value of nil is 1
No, the _numeric_ value of nil is 1. IOW, nil, when interpreted as a
number, is 1. An entirely different story.
> Consistency means something different.
The numeric value of nil is consistently 1.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 18:57 ` Eli Zaretskii
@ 2016-09-05 21:03 ` Drew Adams
2017-07-17 1:37 ` npostavs
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2016-09-05 21:03 UTC (permalink / raw)
To: Eli Zaretskii, Andreas Röhler; +Cc: 24369
> > > • ‘nil’, meaning there is no prefix argument. Its numeric value
> > > is 1,
> >
> > That's the point: Value of nil is 1
>
> No, the _numeric_ value of nil is 1. IOW, nil, when interpreted
> as a number, is 1. An entirely different story.
Exactly. The value of `(prefix-numeric-value nil)' is 1.
That's what "numeric value of" the prefix argument means.
It is also what the shorter expression "the numeric prefix
argument" means.
The fact that the value of some function applied to nil
is 1 does not mean that the value of nil is 1.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#24369: Docu of prefix-numeric-value
2016-09-05 21:03 ` Drew Adams
@ 2017-07-17 1:37 ` npostavs
0 siblings, 0 replies; 9+ messages in thread
From: npostavs @ 2017-07-17 1:37 UTC (permalink / raw)
To: Drew Adams; +Cc: 24369
tags 24369 notabug
close 24369
quit
Drew Adams <drew.adams@oracle.com> writes:
>> > > • ‘nil’, meaning there is no prefix argument. Its numeric value
>> > > is 1,
>> >
>> > That's the point: Value of nil is 1
>>
>> No, the _numeric_ value of nil is 1. IOW, nil, when interpreted
>> as a number, is 1. An entirely different story.
>
> Exactly. The value of `(prefix-numeric-value nil)' is 1.
>
> That's what "numeric value of" the prefix argument means.
> It is also what the shorter expression "the numeric prefix
> argument" means.
>
> The fact that the value of some function applied to nil
> is 1 does not mean that the value of nil is 1.
I think there is nothing more to be done here, so I'm closing the bug.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-07-17 1:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-05 7:52 bug#24369: Docu of prefix-numeric-value Andreas Röhler
2016-09-05 15:57 ` Drew Adams
2016-09-05 17:44 ` Andreas Röhler
2016-09-05 17:46 ` Drew Adams
2016-09-05 17:57 ` Eli Zaretskii
2016-09-05 18:33 ` Andreas Röhler
2016-09-05 18:57 ` Eli Zaretskii
2016-09-05 21:03 ` Drew Adams
2017-07-17 1:37 ` npostavs
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).