zsh-workers
 help / color / mirror / code / Atom feed
* the numeric argument, or the prefix argument
@ 2011-12-11 21:40 Mikael Magnusson
  2011-12-12 12:16 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2011-12-11 21:40 UTC (permalink / raw)
  To: zsh workers

Hi,

On a few places in the manpage, reference is made to 'the prefix
argument', referring to the numeric argument. I don't see any obvious
place to mention that they're the same, so should we just change all
'prefix' to 'numeric' instead? The entry for $NUMERIC and
digit-argument both don't mention 'prefix argument' at the moment.
(Incidentally, it is referred to as 'numeric prefix argument' in the
incarg and transpose-lines help, so there is a minute chance someone
could work it out already.)

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: the numeric argument, or the prefix argument
  2011-12-11 21:40 the numeric argument, or the prefix argument Mikael Magnusson
@ 2011-12-12 12:16 ` Peter Stephenson
  2011-12-12 13:17   ` PATCH: Doc: Explain the numeric argument Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2011-12-12 12:16 UTC (permalink / raw)
  To: zsh workers

On Sun, 11 Dec 2011 22:40:36 +0100
Mikael Magnusson <mikachu@gmail.com> wrote:
> On a few places in the manpage, reference is made to 'the prefix
> argument', referring to the numeric argument. I don't see any obvious
> place to mention that they're the same, so should we just change all
> 'prefix' to 'numeric' instead?

Fine by me.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH: Doc: Explain the numeric argument
  2011-12-12 12:16 ` Peter Stephenson
@ 2011-12-12 13:17   ` Mikael Magnusson
  2011-12-12 15:38     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Magnusson @ 2011-12-12 13:17 UTC (permalink / raw)
  To: zsh-workers

This should change all occurrences of 'prefix argument' or 'numeric prefix
argument' to just 'numeric argument'. I've also added a blurb explaining
what it actually is and does, any opinion on where it should be if not
there, or what it says? I've also changed a completely unrelated set of
() inside example() to LPAR()RPAR() as my yodl complained about them.

---
 Doc/Zsh/compsys.yo |    2 +-
 Doc/Zsh/contrib.yo |   18 +++++++++---------
 Doc/Zsh/options.yo |    4 ++--
 Doc/Zsh/zle.yo     |   24 +++++++++++++++++-------
 4 files changed, 29 insertions(+), 19 deletions(-)

diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 54c0d5d..6c9423e 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -1839,7 +1839,7 @@ tested for all tags valid for the current completion, then the
 tt(default) tag.  The cursor will be moved back to the
 previous line if this style is `true' for all types of match.  Note
 that unlike the tt(ALWAYS_LAST_PROMPT) option this is independent of the
-numeric prefix argument.
+numeric argument.
 )
 kindex(known-hosts-files)
 item(tt(known-hosts-files))(
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index aee0bd7..1732547 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -1834,7 +1834,7 @@ described immediately above, i.e. using styles to decide the word
 boundaries.  However, it is not a replacement for any existing function.
 
 The basic behaviour is to delete the word around the cursor.  There is no
-numeric prefix handling; only the single word around the cursor is
+numeric argument handling; only the single word around the cursor is
 considered.  If the widget contains the string tt(kill), the removed text
 will be placed in the cutbuffer for future yanking.  This can be obtained
 by defining tt(kill-whole-word-match) as follows:
@@ -1894,14 +1894,14 @@ full history line.  Note that leading zeroes must be typed (they are only
 shown when necessary for removing ambiguity).  The entire history is
 searched; there is no distinction between forwards and backwards.
 
-With a prefix argument, the search is not anchored to the start of
+With a numeric argument, the search is not anchored to the start of
 the line; the string typed by the use may appear anywhere in the line
 in the history.
 
 If the widget name contains `tt(-end)' the cursor is moved to the end of
 the line inserted.  If the widget name contains `tt(-space)' any space
 in the text typed is treated as a wildcard and can match anything (hence
-a leading space is equivalent to giving a prefix argument).  Both
+a leading space is equivalent to giving a numeric argument).  Both
 forms can be combined, for example:
 
 example(zle -N history-beginning-search-menu-space-end \ 
@@ -1931,8 +1931,8 @@ vindex(incarg, use of)
 item(tt(incarg))(
 Typing the keystrokes for this widget with the cursor placed on or to the
 left of an integer causes that integer to be incremented by one.  With a
-numeric prefix argument, the number is incremented by the amount of the
-argument (decremented if the prefix argument is negative).  The shell
+numeric argument, the number is incremented by the amount of the
+argument (decremented if the numeric argument is negative).  The shell
 parameter tt(incarg) may be set to change the default increment to
 something other than one.
 
@@ -2380,7 +2380,7 @@ This function may replace the tt(insert-last-word) widget, like so:
 
 example(zle -N insert-last-word smart-insert-last-word)
 
-With a numeric prefix, or when passed command line arguments in a call
+With a numeric argument, or when passed command line arguments in a call
 from another widget, it behaves like tt(insert-last-word), except that
 words in comments are ignored when tt(INTERACTIVE_COMMENTS) is set.
 
@@ -2409,12 +2409,12 @@ The effect is similar to the function of the same name in Emacs.
 
 Transpose the current line with the previous line and move the cursor
 to the start of the next line.  Repeating this (which can be done by
-providing a positive numeric prefix argument) has the effect of moving
+providing a positive numeric argument) has the effect of moving
 the line above the cursor down by a number of lines.
 
-With a negative numeric prefix argument, requires two lines above the
+With a negative numeric argument, requires two lines above the
 cursor.  These two lines are transposed and the cursor moved to the
-start of the previous line.  Using a numeric prefix less than -1
+start of the previous line.  Using a numeric argument less than -1
 has the effect of moving the line above the cursor up by minus that
 number of lines.
 )
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 5aab76a..04605ee 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -567,12 +567,12 @@ tt(IGNORE_BRACES), this option does not disable brace expansion.
 For example, with both options unset a function may be defined
 in the following fashion:
 
-example(args() { echo $# })
+example(args+LPAR()RPAR() { echo $# })
 
 while if either option is set, this does not work and something
 equivalent to the following is required:
 
-example(args() { echo $#; })
+example(args+LPAR()RPAR() { echo $#; })
 
 )
 pindex(KSH_GLOB)
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 1ad4d57..190bf7c 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -40,6 +40,16 @@ the following setting:
 
 example(zle_highlight=(none))
 
+In many places, references are made to the tt(numeric argument).  This can
+by default be entered in emacs mode by holding the alt key and typing
+a number, or pressing escape before each number, and in vi command mode
+by typing the number before entering a command.  Generally the numeric
+argument causes the next command entered to be repeated the specified
+number of times, unless otherwise noted below. See also
+ifzman(the section tt(Arguments) )\
+ifnzman(noderef(Arguments) )\
+for some other ways the numeric argument can be modified.
+
 startmenu()
 menu(Keymaps)
 menu(Zle Builtins)
@@ -1382,7 +1392,7 @@ reexamined.  Note that negative numbers should be preceded by a
 
 If two arguments are given, the second specifies the word on the command
 line in normal array index notation (as a more natural alternative to the
-prefix argument).  Hence 1 is the first word, and -1 (the default) is the
+numeric argument).  Hence 1 is the first word, and -1 (the default) is the
 last word.
 
 If a third argument is given, its value is ignored, but it is used to
@@ -1765,7 +1775,7 @@ tindex(argument-base)
 item(tt(argument-base))(
 Use the existing numeric argument as a numeric base, which must be in the
 range 2 to 36 inclusive.  Subsequent use of tt(digit-argument) and
-tt(universal-argument) will input a new prefix in the given base.
+tt(universal-argument) will input a new numeric argument in the given base.
 The usual hexadecimal convention is used: the letter tt(a) or tt(A)
 corresponds to 10, and so on.  Arguments in bases requiring digits from 10
 upwards are more conveniently input with tt(universal-argument), since
@@ -1922,9 +1932,9 @@ Reads a key sequence, then prints the function bound to that sequence.
 tindex(exchange-point-and-mark)
 item(tt(exchange-point-and-mark) (^X^X) (unbound) (unbound))(
 Exchange the cursor position (point) with the position of the mark.
-Unless a negative prefix argument is given, the region between
+Unless a negative numeric argument is given, the region between
 point and mark is activated so that it can be highlighted.
-If a zero prefix argument is given, the region is activated but
+If a zero numeric argument is given, the region is activated but
 point and mark are not swapped.
 )
 tindex(execute-named-cmd)
@@ -2126,7 +2136,7 @@ Set the specified mark at the cursor position.
 tindex(set-mark-command)
 item(tt(set-mark-command) (^@) (unbound) (unbound))(
 Set the mark at the cursor position.  If called with a negative
-prefix argument, do not set the mark but deactivate the region so that
+numeric argument, do not set the mark but deactivate the region so that
 it is no longer highlighted (it is still usable for other purposes).
 Otherwise the region is marked as active.
 )
@@ -2212,8 +2222,8 @@ tt(set-mark-command).  The region is only highlighted if it is active,
 which is the case if tt(set-mark-command) or tt(exchange-point-and-mark)
 has been called and the line has not been subsequently modified.  The
 region can be deactivated by calling tt(set-mark-command) with a
-negative prefix argument, or reactivated by calling
-tt(exchange-point-and-mark) with a zero prefix argument.  Note
+negative numeric argument, or reactivated by calling
+tt(exchange-point-and-mark) with a zero numeric argument.  Note
 that whether or not the region is active has no effect on its
 use within widgets, it simply determines whether it is highlighted.
 )
-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: Doc: Explain the numeric argument
  2011-12-12 13:17   ` PATCH: Doc: Explain the numeric argument Mikael Magnusson
@ 2011-12-12 15:38     ` Bart Schaefer
  2015-04-16  1:57       ` PATCH: Doc: Explain the numeric argument and be consistent about what we call it Mikael Magnusson
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2011-12-12 15:38 UTC (permalink / raw)
  To: zsh-workers

On Dec 12,  2:17pm, Mikael Magnusson wrote:
} Subject: PATCH: Doc: Explain the numeric argument
}
} This should change all occurrences of 'prefix argument' or 'numeric prefix
} argument' to just 'numeric argument'.

If we're going for consistency, there are at least a few places that use
"numerical" instead of "numeric".

Aside: We're also missing a bunch of index references, e.g., there's no
index entry for zle_highlight.

} I've also added a blurb explaining what it actually is and does, any
} opinion on where it should be if not there, or what it says?

It should either go there, or go at the top of the "Zle Widgets" section
with a forward reference where you have it now.

} +In many places, references are made to the tt(numeric argument).  This can
} +by default be entered in emacs mode by holding the alt key and typing
} +a number, or pressing escape before each number, and in vi command mode
} +by typing the number before entering a command.

The explanation of "by default ..." should perhaps reference the
digit-argument widget, which is why I might consider moving it to the
top of the Widgets section.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH: Doc: Explain the numeric argument and be consistent about what we call it
  2011-12-12 15:38     ` Bart Schaefer
@ 2015-04-16  1:57       ` Mikael Magnusson
  0 siblings, 0 replies; 5+ messages in thread
From: Mikael Magnusson @ 2015-04-16  1:57 UTC (permalink / raw)
  To: zsh-workers

Oops, forgot to update this. Daniel Hahler poked me on IRC about it
since he found it useful, so here it is with the numerical -> numeric
change as well. I didn't move the blurb to the widgets section because
I don't know what to write to reference it without just repeating the
whole blurb anyway.

---
 Doc/Zsh/compsys.yo |  2 +-
 Doc/Zsh/contrib.yo | 18 +++++++++---------
 Doc/Zsh/zle.yo     | 31 +++++++++++++++++++++----------
 3 files changed, 31 insertions(+), 20 deletions(-)

diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 6c6bedb..45afe24 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -1860,7 +1860,7 @@ tested for all tags valid for the current completion, then the
 tt(default) tag.  The cursor will be moved back to the
 previous line if this style is `true' for all types of match.  Note
 that unlike the tt(ALWAYS_LAST_PROMPT) option this is independent of the
-numeric prefix argument.
+numeric argument.
 )
 kindex(known-hosts-files)
 item(tt(known-hosts-files))(
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index ab9e742..24be63e 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -1928,7 +1928,7 @@ described immediately above, i.e. using styles to decide the word
 boundaries.  However, it is not a replacement for any existing function.
 
 The basic behaviour is to delete the word around the cursor.  There is no
-numeric prefix handling; only the single word around the cursor is
+numeric argument handling; only the single word around the cursor is
 considered.  If the widget contains the string tt(kill), the removed text
 will be placed in the cutbuffer for future yanking.  This can be obtained
 by defining tt(kill-whole-word-match) as follows:
@@ -1994,14 +1994,14 @@ full history line.  Note that leading zeroes must be typed (they are only
 shown when necessary for removing ambiguity).  The entire history is
 searched; there is no distinction between forwards and backwards.
 
-With a prefix argument, the search is not anchored to the start of
+With a numeric argument, the search is not anchored to the start of
 the line; the string typed by the use may appear anywhere in the line
 in the history.
 
 If the widget name contains `tt(-end)' the cursor is moved to the end of
 the line inserted.  If the widget name contains `tt(-space)' any space
 in the text typed is treated as a wildcard and can match anything (hence
-a leading space is equivalent to giving a prefix argument).  Both
+a leading space is equivalent to giving a numeric argument).  Both
 forms can be combined, for example:
 
 example(zle -N history-beginning-search-menu-space-end \ 
@@ -2031,8 +2031,8 @@ vindex(incarg, use of)
 item(tt(incarg))(
 Typing the keystrokes for this widget with the cursor placed on or to the
 left of an integer causes that integer to be incremented by one.  With a
-numeric prefix argument, the number is incremented by the amount of the
-argument (decremented if the prefix argument is negative).  The shell
+numeric argument, the number is incremented by the amount of the
+argument (decremented if the numeric argument is negative).  The shell
 parameter tt(incarg) may be set to change the default increment to
 something other than one.
 
@@ -2506,7 +2506,7 @@ This function may replace the tt(insert-last-word) widget, like so:
 
 example(zle -N insert-last-word smart-insert-last-word)
 
-With a numeric prefix, or when passed command line arguments in a call
+With a numeric argument, or when passed command line arguments in a call
 from another widget, it behaves like tt(insert-last-word), except that
 words in comments are ignored when tt(INTERACTIVE_COMMENTS) is set.
 
@@ -2535,12 +2535,12 @@ The effect is similar to the function of the same name in Emacs.
 
 Transpose the current line with the previous line and move the cursor
 to the start of the next line.  Repeating this (which can be done by
-providing a positive numeric prefix argument) has the effect of moving
+providing a positive numeric argument) has the effect of moving
 the line above the cursor down by a number of lines.
 
-With a negative numeric prefix argument, requires two lines above the
+With a negative numeric argument, requires two lines above the
 cursor.  These two lines are transposed and the cursor moved to the
-start of the previous line.  Using a numeric prefix less than -1
+start of the previous line.  Using a numeric argument less than -1
 has the effect of moving the line above the cursor up by minus that
 number of lines.
 )
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 1893e68..5d1b556 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -40,6 +40,17 @@ the following setting:
 
 example(zle_highlight=(none))
 
+In many places, references are made to the tt(numeric argument).  This can
+by default be entered in emacs mode by holding the alt key and typing
+a number, or pressing escape before each number, and in vi command mode
+by typing the number before entering a command.  Generally the numeric
+argument causes the next command entered to be repeated the specified
+number of times, unless otherwise noted below. See also
+ifzman(the em(Arguments) subsection of the em(Widgets) section )\
+ifnzman(noderef(Arguments) )\
+for some other ways the numeric argument can be modified. The default
+bindings mentioned here use the tt(digit-argument) widget.
+
 startmenu()
 menu(Keymaps)
 menu(Zle Builtins)
@@ -649,9 +660,9 @@ item(var(widget) tt([ -n) var(num) tt(]) tt([ -Nw ] [ -K) var(keymap) tt(]) var(
 Invoke the specified widget.  This can only be done when ZLE is
 active; normally this will be within a user-defined widget.
 
-With the options tt(-n) and tt(-N), the current numerical argument will be
+With the options tt(-n) and tt(-N), the current numeric argument will be
 saved and then restored after the call to tt(widget); `tt(-n) var(num)'
-sets the numerical argument temporarily to var(num), while `tt(-N)' sets it
+sets the numeric argument temporarily to var(num), while `tt(-N)' sets it
 to the default, i.e. as if there were none.
 
 With the option tt(-K), var(keymap) will be used as the current keymap
@@ -1497,7 +1508,7 @@ reexamined.  Note that negative numbers should be preceded by a
 
 If two arguments are given, the second specifies the word on the command
 line in normal array index notation (as a more natural alternative to the
-prefix argument).  Hence 1 is the first word, and -1 (the default) is the
+numeric argument).  Hence 1 is the first word, and -1 (the default) is the
 last word.
 
 If a third argument is given, its value is ignored, but it is used to
@@ -1894,14 +1905,14 @@ spaces; if instead it is followed by tt(-2), then tt(forward-char),
 move backward two spaces.
 
 Inside a widget function, if passed an argument, i.e. `tt(zle
-universal-argument) var(num)', the numerical argument will be set to
+universal-argument) var(num)', the numeric argument will be set to
 var(num); this is equivalent to `tt(NUMERIC=)var(num)'.
 )
 tindex(argument-base)
 item(tt(argument-base))(
 Use the existing numeric argument as a numeric base, which must be in the
 range 2 to 36 inclusive.  Subsequent use of tt(digit-argument) and
-tt(universal-argument) will input a new prefix in the given base.
+tt(universal-argument) will input a new numeric argument in the given base.
 The usual hexadecimal convention is used: the letter tt(a) or tt(A)
 corresponds to 10, and so on.  Arguments in bases requiring digits from 10
 upwards are more conveniently input with tt(universal-argument), since
@@ -2058,9 +2069,9 @@ Reads a key sequence, then prints the function bound to that sequence.
 tindex(exchange-point-and-mark)
 item(tt(exchange-point-and-mark) (^X^X) (unbound) (unbound))(
 Exchange the cursor position (point) with the position of the mark.
-Unless a negative prefix argument is given, the region between
+Unless a negative numeric argument is given, the region between
 point and mark is activated so that it can be highlighted.
-If a zero prefix argument is given, the region is activated but
+If a zero numeric argument is given, the region is activated but
 point and mark are not swapped.
 )
 tindex(execute-named-cmd)
@@ -2273,7 +2284,7 @@ Set the specified mark at the cursor position.
 tindex(set-mark-command)
 item(tt(set-mark-command) (^@) (unbound) (unbound))(
 Set the mark at the cursor position.  If called with a negative
-prefix argument, do not set the mark but deactivate the region so that
+numeric argument, do not set the mark but deactivate the region so that
 it is no longer highlighted (it is still usable for other purposes).
 Otherwise the region is marked as active.
 )
@@ -2431,8 +2442,8 @@ tt(set-mark-command).  The region is only highlighted if it is active,
 which is the case if tt(set-mark-command) or tt(exchange-point-and-mark)
 has been called and the line has not been subsequently modified.  The
 region can be deactivated by calling tt(set-mark-command) with a
-negative prefix argument, or reactivated by calling
-tt(exchange-point-and-mark) with a zero prefix argument.  Note
+negative numeric argument, or reactivated by calling
+tt(exchange-point-and-mark) with a zero numeric argument.  Note
 that whether or not the region is active has no effect on its
 use within widgets, it simply determines whether it is highlighted.
 )
-- 
2.2.0.GIT


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-16  2:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-11 21:40 the numeric argument, or the prefix argument Mikael Magnusson
2011-12-12 12:16 ` Peter Stephenson
2011-12-12 13:17   ` PATCH: Doc: Explain the numeric argument Mikael Magnusson
2011-12-12 15:38     ` Bart Schaefer
2015-04-16  1:57       ` PATCH: Doc: Explain the numeric argument and be consistent about what we call it Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).