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

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

bug#24369: Docu of prefix-numeric-value


From: Eli Zaretskii
Subject: bug#24369: Docu of prefix-numeric-value
Date: Mon, 05 Sep 2016 20:57:31 +0300

> 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.





reply via email to

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