1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-28 18:40:55 +02:00

11478; 3.1.7-pre-4

This commit is contained in:
Peter Stephenson 2000-05-21 18:27:36 +00:00
parent d28807ea39
commit 60205c81b8
10 changed files with 220 additions and 204 deletions

View file

@ -1,3 +1,12 @@
2000-05-21 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
* Config/version.mk: 3.1.7-pre-4.
* 11478: Doc/Zsh/mod_complist.yo, Doc/Zsh/mod_computil.yo,
Doc/Zsh/mod_parameter.yo, Doc/Zsh/mod_zle.yo,
Doc/Zsh/mod_zprof.yo, Doc/Zsh/mod_zpty.yo, Doc/Zsh/mod_zutil.yo,
Doc/Zsh/zftpsys.yo: Wording changes.
2000-05-20 Bart Schaefer <schaefer@zsh.org> 2000-05-20 Bart Schaefer <schaefer@zsh.org>
* 11477: Doc/Zsh/compsys.yo: Alphabetize itemized lists. * 11477: Doc/Zsh/compsys.yo: Alphabetize itemized lists.

View file

@ -27,5 +27,5 @@
# This must also serve as a shell script, so do not add spaces around the # This must also serve as a shell script, so do not add spaces around the
# `=' signs. # `=' signs.
VERSION=3.1.7-pre-3 VERSION=3.1.7-pre-4
VERSION_DATE='May 8, 2000' VERSION_DATE='May 21, 2000'

View file

@ -18,13 +18,13 @@ dynamic loading, `tt(zmodload zsh/complist)' is required.
vindex(ZLS_COLORS) vindex(ZLS_COLORS)
vindex(ZLS_COLOURS) vindex(ZLS_COLOURS)
The parameters tt(ZLS_COLORS) and tt(ZLS_COLOURS) describe how matches The parameters tt(ZLS_COLORS) and tt(ZLS_COLOURS) describe how matches
are highlighted. To turn on highlighting an empty value suffices, in are highlighted. To turn on highlighting an empty value suffices, in
which case all the default values given below will be used. The format of the which case all the default values given below will be used. The format of
value of these parameters is the same as used by the GNU version of the the value of these parameters is the same as used by the GNU version of the
tt(ls) command: a colon-separated list of specifications of the form tt(ls) command: a colon-separated list of specifications of the form
`var(name)=var(value)'. The var(name) may be one of the following strings, `var(name)=var(value)'. The var(name) may be one of the following strings,
most of which specify file types for which the var(value) will be used. The most of which specify file types for which the var(value) will be used.
strings and their default values are: The strings and their default values are:
startitem() startitem()
item(tt(no 0))( item(tt(no 0))(
@ -55,7 +55,7 @@ item(tt(ex 35))(
for executable files for executable files
) )
item(tt(mi) var(none))( item(tt(mi) var(none))(
for non-existent file (default is the value defined for tt(fi)) for a non-existent file (default is the value defined for tt(fi))
) )
item(tt(lc \e[))( item(tt(lc \e[))(
for the left code (see below) for the left code (see below)
@ -79,31 +79,31 @@ Apart from these strings, the var(name) may also be an asterisk
(`tt(*)') followed by any string. The var(value) given for such a (`tt(*)') followed by any string. The var(value) given for such a
string will be used for all files whose name ends with the string. string will be used for all files whose name ends with the string.
The var(name) may also be a equal sign (`tt(=)') followed by a The var(name) may also be a equal sign (`tt(=)') followed by a
pattern. The var(value) given for this pattern will be used for all pattern. The var(value) given for this pattern will be used for all
matches (not only filenames) whose display string are matched by matches (not just filenames) whose display string are matched by
the pattern. Definitions for both of these take precedence over the the pattern. Definitions for both of these take precedence over the
values defined for file types and the form with the leading asterisk values defined for file types and the form with the leading asterisk
takes precedence over the form with the leading equal sign. takes precedence over the form with the leading equal sign.
The last form also allows to color separate parts of the displayed The last form also allows different parts of the displayed
strings using different colors. For this, the pattern has to use the strings to be colored differently. For this, the pattern has to use the
`tt((#b))' globbing flag and pairs of parentheses surrounding the `tt((#b))' globbing flag and pairs of parentheses surrounding the
parts of the strings that are to be colored differently. In this case parts of the strings that are to be colored differently. In this case
the var(value) may consist of more than one color code separated by the var(value) may consist of more than one color code separated by
equal signs. The first code will be used for all parts for which no equal signs. The first code will be used for all parts for which no
explicit code is specified and the following codes will be used for explicit code is specified and the following codes will be used for
the parts matched by the sub-patterns in parentheses. For example, the parts matched by the sub-patterns in parentheses. For example,
the specification `tt(=(#b)(?)*(?)=0=3=7)' will be used for all the specification `tt(=(#b)(?)*(?)=0=3=7)' will be used for all
matches which are at least two characters long and will make the use matches which are at least two characters long and will make the use
the code `tt(3)' for the first character, `tt(7)' for the last the code `tt(3)' for the first character, `tt(7)' for the last
character and `tt(0)' for the rest. character and `tt(0)' for the rest.
All three forms of var(name) may be preceded by a pattern in All three forms of var(name) may be preceded by a pattern in
parentheses. If such a pattern is given, the var(value) will be used parentheses. If this is given, the var(value) will be used
only for matches in groups whose names are matched by the pattern only for matches in groups whose names are matched by the pattern
given in the parentheses. E.g. `tt((g*)m*=43)' says to highlight all given in the parentheses. For example, `tt((g*)m*=43)' highlights all
matches beginning with `tt(m)' in groups whose names begin with matches beginning with `tt(m)' in groups whose names begin with
`tt(g)' using the color code `tt(43)'. In case of the `tt(lc)', `tt(g)' using the color code `tt(43)'. In case of the `tt(lc)',
`tt(rc)', and `tt(ec)' codes, the group pattern is ignored. `tt(rc)', and `tt(ec)' codes, the group pattern is ignored.
Note also that all patterns are tried in the order in which they Note also that all patterns are tried in the order in which they
@ -117,38 +117,39 @@ then the value of tt(ec) if that is defined or the values of tt(lc),
tt(no), and tt(rc) if tt(ec) is not defined. tt(no), and tt(rc) if tt(ec) is not defined.
The default values are ISO 6429 (ANSI) compliant and can be used on The default values are ISO 6429 (ANSI) compliant and can be used on
vt100 compatible terminals such as tt(xterm)s. On monochrome terminals vt100 compatible terminals such as tt(xterm)s. On monochrome terminals
the default values will have no visual effect. the default values will have no visible effect.
If the shell function based completion system is used, these If the completion system based around shell functions is used, these
parameters should not be set directly because the system controls them parameters should not be set directly because the system controls them
itself. Instead, the tt(list-colors) style should be used (see itself. Instead, the tt(list-colors) style should be used (see
ifzman(the section `Completion System Configuration' in zmanref(zshcompsys))\ ifzman(the section `Completion System Configuration' in zmanref(zshcompsys))\
ifnzman(noderef(Completion System Configuration))\ ifnzman(noderef(Completion System Configuration))\
). ).
subsect(Scrolling in completion listings) subsect(Scrolling in completion listings)
To be able to scroll through a completion list, the tt(LISTPROMPT) To enable scrolling through a completion list, the tt(LISTPROMPT)
parameter has to be set. Its value will be used as the prompt, if it parameter must be set. Its value will be used as the prompt; if it
is the empty string, a default prompt will be used. The value may is the empty string, a default prompt will be used. The value may
contain escapes of the form `tt(%x)'. It supports the escapes contain escapes of the form `tt(%x)'. It supports the escapes
`tt(%B)', `tt(%b)', `tt(%S)', `tt(%s)', `tt(%U)', `tt(%u)' and `tt(%B)', `tt(%b)', `tt(%S)', `tt(%s)', `tt(%U)', `tt(%u)' and
`tt(%{...%})' known from the shell prompts and three pairs of `tt(%{...%})' used also in shell prompts as well as three pairs of
additional sequences. A `tt(%l)' or `tt(%L)' is replaced by the number additional sequences: a `tt(%l)' or `tt(%L)' is replaced by the number
of the last line shown and the total number of lines in the form of the last line shown and the total number of lines in the form
`var(number)tt(/)var(total)'. A `tt(%m)' or `tt(%M)' is replaced with `var(number)tt(/)var(total)'; a `tt(%m)' or `tt(%M)' is replaced with
the number of the last match shown and the total number of matches and the number of the last match shown and the total number of matches; and
`tt(%p)' or `tt(%P)' is replaced with `tt(Top)', `tt(Bottom)' or the `tt(%p)' or `tt(%P)' is replaced with `tt(Top)', `tt(Bottom)' or the
position of the first line shown in percent of the total number of position of the first line shown in percent of the total number of
lines, respectively. In each of these cases the one with the uppercase lines, respectively. In each of these cases the form with the uppercase
letter will be replaced with a string of fixed width, padded to the letter will be replaced with a string of fixed width, padded to the
right with spaces. right with spaces, while the lowercase form will not be padded.
If tt(LISTPROMPT) is set, the completion code will not ask if the list If the option att(LISTPROMPT) is set, the completion code will not ask if
should be shown. Instead it immediately starts displaying the list, the list should be shown. Instead it immediately starts displaying the
stopping after the first screenful, showing the prompt at the bottom, list, stopping after the first screenful, showing the prompt at the bottom,
waiting for a keypress after temporarily switching to the waiting for a keypress after temporarily switching to the tt(listscroll)
tt(listscroll) keymap. Some of the zle functions have special meaning: keymap. Some of the zle functions have a special meaning while scrolling
lists:
startitem() startitem()
item(tt(send-break))( item(tt(send-break))(
@ -165,13 +166,13 @@ scrolls forward one screenful
enditem() enditem()
Every other character stops listing and immediately processes the key Every other character stops listing and immediately processes the key
as usual. Any key that is not bound in the tt(listscroll) keymap or as usual. Any key that is not bound in the tt(listscroll) keymap or
that is bound to tt(undefined-key) is looked up in the keymap that is bound to tt(undefined-key) is looked up in the keymap
currently selected. currently selected.
As for the tt(ZLS_COLORS) and tt(ZLS_COLOURS) parameters, As for the tt(ZLS_COLORS) and tt(ZLS_COLOURS) parameters,
tt(LISTPROMPT) should not be set directly when using the shell tt(LISTPROMPT) should not be set directly when using the shell
function based completion system. Instead, the tt(list-prompt) style function based completion system. Instead, the tt(list-prompt) style
should be used. should be used.
subsect(Menu selection) subsect(Menu selection)
@ -184,7 +185,7 @@ shell is set up to return to the last prompt after showing a
completion list (see the tt(ALWAYS_LAST_PROMPT) option in completion list (see the tt(ALWAYS_LAST_PROMPT) option in
ifzman(zmanref(zshoptions))\ ifzman(zmanref(zshoptions))\
ifnzman(noderef(Options))\ ifnzman(noderef(Options))\
). It can be invoked directly by ). It can be invoked directly by
the widget tt(menu-select) defined by the module. Alternatively, the widget tt(menu-select) defined by the module. Alternatively,
the parameter tt(MENUSELECT) can be set to an integer, which give the the parameter tt(MENUSELECT) can be set to an integer, which give the
minimum number of matches that must be present before menu selection is minimum number of matches that must be present before menu selection is
@ -194,58 +195,58 @@ to one of the options tt(MENU_COMPLETE) or tt(AUTO_MENU) being set. If
tt(MENUSELECT) is set, but is 0, 1 or empty, menu selection will always be tt(MENUSELECT) is set, but is 0, 1 or empty, menu selection will always be
started during an ambiguous menu completion. started during an ambiguous menu completion.
When using the shell function based completion system, the When using the completion system based on shell functions, the
tt(MENUSELECT) parameter should not be used (like the tt(ZLS_COLORS) tt(MENUSELECT) parameter should not be used (like the tt(ZLS_COLORS)
and tt(ZLS_COLOURS) parameters described above). Instead, the tt(menu) and tt(ZLS_COLOURS) parameters described above). Instead, the tt(menu)
style should be used. style should be used with the tt(select=)var(...) keyword.
After menu-selection is started, the matches will be listed. If there After menu-selection is started, the matches will be listed. If there
are more matches than fit on the screen, only the first screenful is are more matches than fit on the screen, only the first screenful is
shown. The shown. The
matches to insert into the command line can be selected from this matches to insert into the command line can be selected from this
list. In the list one match is highlighted using the value for tt(ma) list. In the list one match is highlighted using the value for tt(ma)
from the tt(ZLS_COLORS) or tt(ZLS_COLOURS) parameter. The default from the tt(ZLS_COLORS) or tt(ZLS_COLOURS) parameter. The default
value for this is `tt(7)' which forces the selected match to be value for this is `tt(7)' which forces the selected match to be
highlighted using standout mode on a vt100-compatible terminal. If highlighted using standout mode on a vt100-compatible terminal. If
neither tt(ZLS_COLORS) nor tt(ZLS_COLOURS) is set, the same terminal neither tt(ZLS_COLORS) nor tt(ZLS_COLOURS) is set, the same terminal
control sequence as for the `tt(%S)' escape in prompts is used. control sequence as for the `tt(%S)' escape in prompts is used.
If there are more matches than fit on the screen and the parameter If there are more matches than fit on the screen and the parameter
tt(MENUPROMPT) is set, its value will be shown below the matches. It tt(MENUPROMPT) is set, its value will be shown below the matches. It
supports the same escape sequences as tt(LISTPROMPT), but the number supports the same escape sequences as tt(LISTPROMPT), but the number
of the match or line shown will be that of the one where the mark is of the match or line shown will be that of the one where the mark is
placed. If its value is the empty string, a default prompt will be placed. If its value is the empty string, a default prompt will be
used. used.
The tt(MENUSCROLL) parameter can be used to specify how the list is The tt(MENUSCROLL) parameter can be used to specify how the list is
scrolled. If the parameter is unset, this is done line by line, if it scrolled. If the parameter is unset, this is done line by line, if it
is set to `tt(0)' (zero), the list will scrolled half the number of is set to `tt(0)' (zero), the list will scrolled half the number of
lines of the screen. If the value is positive, it gives the number of lines of the screen. If the value is positive, it gives the number of
lines to scroll and if it is negative, the list will be scrolled lines to scroll and if it is negative, the list will be scrolled
the number of lines of the screen minus the (absolute) value. the number of lines of the screen minus the (absolute) value.
As for the tt(ZLS_COLORS), tt(ZLS_COLOURS) and tt(LISTPROMPT) As for the tt(ZLS_COLORS), tt(ZLS_COLOURS) and tt(LISTPROMPT)
parameters, neither tt(MENUPROMPT) nor tt(MENUSCROLL) should be parameters, neither tt(MENUPROMPT) nor tt(MENUSCROLL) should be
set directly when using the shell function based completion set directly when using the shell function based completion
system. Instead, the tt(select-prompt) and tt(select-scroll) styles system. Instead, the tt(select-prompt) and tt(select-scroll) styles
should be used. should be used.
The completion code sometimes decides not to show all of the matches The completion code sometimes decides not to show all of the matches
in the list. These hidden matches are either matches for which the in the list. These hidden matches are either matches for which the
completion function which added them explicitly requested that they completion function which added them explicitly requested that they
not appear in the list (using the tt(-n) option of the tt(compadd) not appear in the list (using the tt(-n) option of the tt(compadd)
builtin command) or they are matches which duplicate a string already builtin command) or they are matches which duplicate a string already
in the list (because they differ only in things like prefixes or in the list (because they differ only in things like prefixes or
suffixes that are not displayed). In the list used for menu-selection, suffixes that are not displayed). In the list used for menu-selection,
however, even these matches are shown so that it is possible to select however, even these matches are shown so that it is possible to select
them. To highlight such matches the tt(hi) and tt(du) capabilities in them. To highlight such matches the tt(hi) and tt(du) capabilities in
the tt(ZLS_COLORS) and tt(ZLS_COLOURS) parameters are supported for the tt(ZLS_COLORS) and tt(ZLS_COLOURS) parameters are supported for
hidden matches of the first and second kind, respectively. hidden matches of the first and second kind, respectively.
Selecting matches is done by moving the mark around using the zle movement Selecting matches is done by moving the mark around using the zle movement
functions. When not all matches can be shown on the screen at the same functions. When not all matches can be shown on the screen at the same
time, the list will scroll up and down when crossing the top or time, the list will scroll up and down when crossing the top or
bottom line. The following zle functions have special meaning during bottom line. The following zle functions have special meaning during
menu selection: menu selection:
startitem() startitem()
@ -322,18 +323,17 @@ moves the mark to the previous match
) )
enditem() enditem()
All movement function do wrap-around at the edges and All movement functions wrap around at the edges; any other zle function not
any other zle function leaves menu-selection and executes that function. listed leaves menu-selection and executes that function. It is possible to
It is possible to make widgets in the above list do the same by using the make widgets in the above list do the same by using the form of the widget
form of the widget with a `tt(.)' in front. For example, the widget with a `tt(.)' in front. For example, the widget `tt(.accept-line)' has
`tt(.accept-line)' has the effect of leaving menu selection and accepting the effect of leaving menu selection and accepting the entire command line.
the entire command line.
During this selection the widget uses the keymap tt(menuselect). Any During this selection the widget uses the keymap tt(menuselect). Any
key that is not defined in this keymap or that is bound to key that is not defined in this keymap or that is bound to
tt(undefined-key) is looked up in the keymap currently selected. This tt(undefined-key) is looked up in the keymap currently selected. This
is used to ensure that the most important keys used during selection is used to ensure that the most important keys used during selection
have sensible default (namely the cursor keys, return, and TAB). However, (namely the cursor keys, return, and TAB) have sensible defaults. However,
keys in the the tt(menuselect) keymap can be modified directly using the keys in the the tt(menuselect) keymap can be modified directly using the
tt(bindkey) builtin command (see tt(bindkey) builtin command (see
ifzman(zmanref(zshmodules))\ ifzman(zmanref(zshmodules))\

View file

@ -4,22 +4,22 @@ completion system.
!MOD!) !MOD!)
cindex(completion, utility) cindex(completion, utility)
The tt(zsh/computil) module adds several builtin commands that are used by The tt(zsh/computil) module adds several builtin commands that are used by
some of the completion functions in the shell function based some of the completion functions in the completion system based on shell
completions system (see functions (see
ifzman(zmanref(zshcompsys))\ ifzman(zmanref(zshcompsys))\
ifnzman(noderef(Completion System)) ifnzman(noderef(Completion System))
). Except for tt(compquote) these builtin commands are very ). Except for tt(compquote) these builtin commands are very
specialised and thus not very interesting when writing your own specialised and thus not very interesting when writing your own
completion functions. In short, these builtin commands are: completion functions. In summary, these builtin commands are:
startitem() startitem()
item(tt(compquote) var(names) ...)( item(tt(compquote) var(names) ...)(
There may be reasons to write completion functions that have to add There may be reasons to write completion functions that have to add
the matches using the tt(-Q) option to tt(compadd) and do the quoting the matches using the tt(-Q) option to tt(compadd) and perform quoting
themselves. Instead of interpreting the first character of the themselves. Instead of interpreting the first character of the
tt(all_quotes) key of the tt(compstate) special association and using tt(all_quotes) key of the tt(compstate) special association and using
the tt(q) flag for parameter expansions, one can use this builtin the tt(q) flag for parameter expansions, one can use this builtin
command. The arguments are the names of scalar or array parameters command. The arguments are the names of scalar or array parameters
and the values of these parameters are quoted as needed for the and the values of these parameters are quoted as needed for the
innermost quoting level. innermost quoting level.
@ -28,25 +28,25 @@ The return value is non-zero in case of an error and zero otherwise.
item(tt(compdescribe))( item(tt(compdescribe))(
This is used by the tt(_describe) function to build the displays for This is used by the tt(_describe) function to build the displays for
the matches and to get the strings to add as matches with their the matches and to get the strings to add as matches with their
options. The first call has to give the tt(-i) or tt(-I) option as the options. On the first call one of the options tt(-i) or tt(-I) should be
first argument. In the first case, display strings without the supplied as the first argument. In the first case, display strings without
descriptions will be generated, in the second case, the string used to the descriptions will be generated, in the second case, the string used to
separate the matches from their descriptions has to be given as the separate the matches from their descriptions must be given as the
second argument and the descriptions (if any) will be shown. All other second argument and the descriptions (if any) will be shown. All other
arguments are like the definition arguments to tt(_describe) itself. arguments are like the definition arguments to tt(_describe) itself.
Once tt(compdescribe) has been called with either the tt(-i) or the Once tt(compdescribe) has been called with either the tt(-i) or the
tt(-I) option, it can be repeatedly called with the tt(-g) option and tt(-I) option, it can be repeatedly called with the tt(-g) option and
the names of five arrays as its arguments. This will step through the the names of five arrays as its arguments. This will step through the
different sets of matches and store the options in the first array, different sets of matches and store the options in the first array,
the strings with descriptions in the second, the matches for these in the strings with descriptions in the second, the matches for these in
the third, the strings without descriptions in the fourth, and the the third, the strings without descriptions in the fourth, and the
matches for them in the fifth array. These are then directly given to matches for them in the fifth array. These are then directly given to
tt(compadd) to register the matches with the completion code. tt(compadd) to register the matches with the completion code.
) )
item(tt(comparguments))( item(tt(comparguments))(
This is used by the tt(_arguments) function to do the argument and This is used by the tt(_arguments) function to do the argument and
command line parsing. Like tt(compdescribe) it has an option tt(-i) to command line parsing. Like tt(compdescribe) it has an option tt(-i) to
do the parsing and initialize some internal state and various options do the parsing and initialize some internal state and various options
to access the state information to decide what should be completed. to access the state information to decide what should be completed.
) )

View file

@ -28,7 +28,7 @@ hash table.
) )
vindex(functions) vindex(functions)
item(tt(functions))( item(tt(functions))(
This association maps names of enabled functions to their This associative array maps names of enabled functions to their
definitions. Setting a key in it is like defining a function with the definitions. Setting a key in it is like defining a function with the
name given by the key and the body given by the value. Unsetting a key name given by the key and the body given by the value. Unsetting a key
removes the definition for the function named by the key. removes the definition for the function named by the key.
@ -39,7 +39,7 @@ Like tt(functions) but for disabled functions.
) )
vindex(builtins) vindex(builtins)
item(tt(builtins))( item(tt(builtins))(
This association gives information about the builtin commands This associative array gives information about the builtin commands
currently enabled. The keys are the names of the builtin commands and currently enabled. The keys are the names of the builtin commands and
the values are either `tt(undefined)' for builtin commands that will the values are either `tt(undefined)' for builtin commands that will
automatically be loaded from a module if invoked or `tt(defined)' for automatically be loaded from a module if invoked or `tt(defined)' for
@ -90,7 +90,7 @@ Setting or unsetting keys in this array is not possible.
) )
vindex(modules) vindex(modules)
item(tt(modules))( item(tt(modules))(
An association giving information about module. The keys are the names An associative array giving information about modules. The keys are the names
of the modules builtin, loaded, or registered to be autoloaded. The of the modules builtin, loaded, or registered to be autoloaded. The
value says which state the named module is in and is one of the value says which state the named module is in and is one of the
strings tt(builtin), tt(loaded), or tt(autoloaded). strings tt(builtin), tt(loaded), or tt(autoloaded).
@ -105,7 +105,7 @@ directory, the current working directory.
) )
vindex(history) vindex(history)
item(tt(history))( item(tt(history))(
This association maps history event numbers to the full history lines. This associative array maps history event numbers to the full history lines.
) )
vindex(historywords) vindex(historywords)
item(tt(historywords))( item(tt(historywords))(
@ -113,16 +113,17 @@ A special array containing the words stored in the history.
) )
vindex(jobdirs) vindex(jobdirs)
item(tt(jobdirs))( item(tt(jobdirs))(
This association maps job numbers to the directories from which the job was started (which may not be the current directory of the job). This associative array maps job numbers to the directories from which the
job was started (which may not be the current directory of the job).
) )
vindex(jobtexts) vindex(jobtexts)
item(tt(jobtexts))( item(tt(jobtexts))(
This association maps job numbers to the texts of the command lines This associative array maps job numbers to the texts of the command lines
that were used to start the jobs. that were used to start the jobs.
) )
vindex(jobstates) vindex(jobstates)
item(tt(jobstates))( item(tt(jobstates))(
This association gives information about the states of the jobs This associative array gives information about the states of the jobs
currently known. The keys are the job numbers and the values are currently known. The keys are the job numbers and the values are
strings of the form strings of the form
`var(job-state):var(pid)tt(=)var(state)tt(...)'. The var(job-state) `var(job-state):var(pid)tt(=)var(state)tt(...)'. The var(job-state)
@ -134,12 +135,12 @@ of that process.
) )
vindex(nameddirs) vindex(nameddirs)
item(tt(nameddirs))( item(tt(nameddirs))(
This association maps the names of named directories to the pathnames This associative array maps the names of named directories to the pathnames
they stand for. they stand for.
) )
vindex(userdirs) vindex(userdirs)
item(tt(userdirs))( item(tt(userdirs))(
This association maps user names to the pathnames of their home This associative array maps user names to the pathnames of their home
directories. directories.
) )
vindex(funcstack) vindex(funcstack)

View file

@ -259,20 +259,20 @@ immediately after return from the widget.
) )
item(tt(-M) var(string))( item(tt(-M) var(string))(
As with the tt(-R) option, the var(string) will be displayed below the As with the tt(-R) option, the var(string) will be displayed below the
command line. But unlike the tt(-R) option the string not be put into command line; unlike the tt(-R) option, the string will not be put into
the status line but will instead be printed normally below the the status line but will instead be printed normally below the
prompt. This means that the var(string) will still be displayed after prompt. This means that the var(string) will still be displayed after
the widget returns (until it is overwritten by subsequent commands). the widget returns (until it is overwritten by subsequent commands).
) )
item(tt(-U) var(string))( item(tt(-U) var(string))(
This pushes the characters in the var(string) onto the input stack of This pushes the characters in the var(string) onto the input stack of
ZLE. After the widget currently executed finishes ZLE will behave as ZLE. After the widget currently executed finishes ZLE will behave as
if the characters in the var(string) were typed by the user. if the characters in the var(string) were typed by the user.
Note that since ZLE uses a stack, using tt(zle) with this option more As ZLE uses a stack, if this option is used repeatedly
than once will make the last string pushed be used first. The the last string pushed onto the stack will be processed first. However,
characters in each var(string) will be used in the order in which they the characters in each var(string) will be processed in the order in which
appear in the string, though. they appear in the string.
) )
item(var(widget) tt([ -n) var(num) tt(]) tt([ -N ]) var(args) ...)( item(var(widget) tt([ -n) var(num) tt(]) tt([ -N ]) var(args) ...)(
Invoke the specified widget. This can only be done when ZLE is Invoke the specified widget. This can only be done when ZLE is
@ -303,7 +303,7 @@ it should call the tt(beep) widget directly.
) )
enditem() enditem()
With no options and no arguments, only the returns status will be With no options and no arguments, only the return status will be
set. It is zero if ZLE is currently active and widgets could be set. It is zero if ZLE is currently active and widgets could be
invoked using this builtin command and non-zero if ZLE is not active. invoked using this builtin command and non-zero if ZLE is not active.
) )

View file

@ -1,61 +1,60 @@
COMMENT(!MOD! COMMENT(!MOD!zsh/zprof
A module allowing profiling for shell functions. A module allowing profiling for shell functions.
!MOD!) !MOD!)
cindex(functions, profiling) cindex(functions, profiling)
When loaded, the tt(zprof) module makes shell functions be When loaded, the tt(zsh/zprof) causes shell functions to be profiled.
profiled. The profiling results can be obtained with the tt(zprof) The profiling results can be obtained with the tt(zprof)
builtin command made available by this module. There is no way to turn builtin command made available by this module. There is no way to turn
profiling off other than unloading this module. profiling off other than unloading the module.
startitem() startitem()
findex(zprof) findex(zprof)
item(tt(zprof) [ tt(-c) ])( item(tt(zprof) [ tt(-c) ])(
Without the tt(-c) option, tt(zprof) lists profiling results to Without the tt(-c) option, tt(zprof) lists profiling results to
standard output. The format is comparable to that of commands like standard output. The format is comparable to that of commands like
tt(gprof). tt(gprof).
At the top there is a summary listing all functions that were called At the top there is a summary listing all functions that were called
at least once. This summary is sorted in decreasing order by the at least once. This summary is sorted in decreasing order of the
amount of time spent in the functions themselves. Each line is amount of time spent in each. The lines contain
preceded by the number of the function in this order (which is used in the number of the function in order, which is used in
other parts of the list in suffixes of the form other parts of the list in suffixes of the form
`tt([)var(num)tt(])'). The second column gives the number of calls `tt([)var(num)tt(])'), then the number of calls made to the function.
made to this function. The next three columns list the time in The next three columns list the time in
milliseconds spent in the function and its descendents, the average milliseconds spent in the function and its descendents, the average
time in milliseconds spent in the function and its descendents per time in milliseconds spent in the function and its descendents per
call and the percentage of time spent in all shell functions used in call and the percentage of time spent in all shell functions used in
this function and its descendents. The following three columns give this function and its descendents. The following three columns give
the same information, but counting only the time spent in the function the same information, but counting only the time spent in the function
itself. The last column finally shows the name of the function. itself. The final column shows the name of the function.
After the summary, detailed information about every function that was After the summary, detailed information about every function that was
invoked is listed, sorted in decreasing order by the amount of time invoked is listed, sorted in decreasing order of the amount of time spent
spent in the functions and their descendents. Each of these entries in each function and its descendents. Each of these entries consists of
consists of descriptions for the functions that called the function descriptions for the functions that called the function described, the
described, the function itself, and the functions that were called function itself, and the functions that were called from it. The
from it. The description for the function itself has the same format description for the function itself has the same format as in the summary
as in the summary (and shows the same information). The other lines (and shows the same information). The other lines don't show the number of
don't show the number of the function at the beginning and have their the function at the beginning and have their function named indented to
function named indented to make it easier to visually distinguish the make it easier to distinguish the line showing the function described in
line showing the function described in the section from the the section from the surrounding lines.
surrounding lines.
The information shown for the calling and the called functions is The information shown in this case is almost the same as in the summary,
almost the same as in the summary, but is always only for the call arc but only refers to the call hierarchy being displayed. For example, for a
described. For example, for a calling function the column showing the calling function the column showing the total running time lists the time
total running time lists the time spent in the described function and spent in the described function and its descendents only for the times when
its descendents when it was called from the calling it was called from that particular calling function. Likewise, for a
function. Likewise, for a called function, this columns lists the called function, this columns lists the total time spent in the called
total time spent in the called function and its descendents when it function and its descendents only for the times when it was called from the
was called from the function described. function described.
For the calling and the called functions, the column showing the Also in this case, the column showing the number of calls to a function
number of calls to a function also show the total number of also shows a slash and then the total number of invocations made to the
invocations made to the called function after a slash. called function.
As long as the tt(zprof) module is loaded, profiling will be done and As long as the tt(zsh/zprof) module is loaded, profiling will be done and
multiple invocations of the tt(zprof) builtin command will show the multiple invocations of the tt(zprof) builtin command will show the
times and numbers of calls since the module was loaded. With the times and numbers of calls since the module was loaded. With the
tt(-c) option, the tt(zprof) builtin command will reset its internal tt(-c) option, the tt(zprof) builtin command will reset its internal
counters and will not show the listing. counters and will not show the listing.
) )

View file

@ -11,30 +11,32 @@ xitem(tt(zpty) tt(-w) [ tt(-n) ] var(name) var(strings ...))
xitem(tt(zpty) tt(-r) var(name) [ var(param) [ var(pattern) ] ]) xitem(tt(zpty) tt(-r) var(name) [ var(param) [ var(pattern) ] ])
item(tt(zpty) [ tt(-L) ])( item(tt(zpty) [ tt(-L) ])(
In the first form, the var(command) is started with the var(args) as In the first form, the var(command) is started with the var(args) as
arguments. After this, the var(name) can be used in further calls to arguments. The command runs under a newly assigned pseudo-terminal; this
tt(zpty) to refer to this command. With the tt(-e) option given, the is useful for running commands non-interactively which expect an
interactive environment. The var(name) given is used to refer to this
command in later calls to tt(pty). With the tt(-e) option given, the
pseudo-terminal will be set up so that input characters are echoed and pseudo-terminal will be set up so that input characters are echoed and
with the tt(-b) option given, input and output from and to the with the tt(-b) option given, input and output from and to the
pseudo-terminal will be blocking. pseudo-terminal will be blocking.
The second form with the tt(-d) option is used to delete commands The second form with the tt(-d) option is used to delete commands
started before by giving their var(names). If no var(names) are given, previously started by supplying a list of their var(name)s. If no
all commands are deleted. Deleting a command makes the HUP signal be var(names) are given, all commands are deleted. Deleting a command causes
sent to the process started for it. the HUP signal to be sent to the corresponding process.
The tt(-w) option can be used to sent the command var(name) the given The tt(-w) option can be used to send the command var(name) the given
var(strings) as input (separated by spaces). If the tt(-n) option is var(strings) as input (separated by spaces). If the tt(-n) option is
not given, a newline will be sent after the last var(string). not given, a newline will be added at the end.
The tt(-r) option can be used to read the output of the command The tt(-r) option can be used to read the output of the command
var(name). Without a var(param) argument, the string read will be var(name). Without a var(param) argument, the string read will be
printed to standard output. With a var(param) argument, the string printed to standard output. With a var(param) argument, the string
read will be put in the parameter named var(param). If the read will be put in the parameter named var(param). If the
var(pattern) is also given, output will be read until the whole string var(pattern) is also given, output will be read until the whole string
read matches the var(pattern). read matches the var(pattern).
The last form without any arguments is used to list the commands The last form without any arguments is used to list the commands
currently defined. If the tt(-L) option is given, this is done in the currently defined. If the tt(-L) option is given, this is done in the
form of calls to the tt(zpty) builtin. form of calls to the tt(zpty) builtin.
) )
enditem() enditem()

View file

@ -14,14 +14,14 @@ xitem(tt(zstyle -g) var(name) [ var(pattern) [ var(style) ] ])
xitem(tt(zstyle -abhs) var(context) var(style) var(name) [ var(sep) ]) xitem(tt(zstyle -abhs) var(context) var(style) var(name) [ var(sep) ])
xitem(tt(zstyle -Tt) var(context) var(style) [ var(strings) ...]) xitem(tt(zstyle -Tt) var(context) var(style) [ var(strings) ...])
item(tt(zstyle -m) var(context) var(style) var(pattern))( item(tt(zstyle -m) var(context) var(style) var(pattern))(
This builtin command is used to define and lookup styles. Styles are This builtin command is used to define and lookup styles. Styles are
pairs of names and values, where the values consist of any number of pairs of names and values, where the values consist of any number of
strings. They are stored together with patterns and lookup is done by strings. They are stored together with patterns and lookup is done by
giving a string, called the `context', which is compared to the giving a string, called the `context', which is compared to the
patterns. The definition stored for the first matching pattern will be patterns. The definition stored for the first matching pattern will be
returned. For this, the patterns are ordered from most specific to returned. For this, the patterns are ordered from most specific to
less specific and patterns that are equally specific keep the order in less specific and patterns that are equally specific keep the order in
which they were defined. A pattern is considered to be more specific which they were defined. A pattern is considered to be more specific
than another if it contains more components (substrings separated by than another if it contains more components (substrings separated by
colons) or if the patterns for the components are more specific, where colons) or if the patterns for the components are more specific, where
simple strings are considered to be more specific than patterns and simple strings are considered to be more specific than patterns and
@ -95,36 +95,36 @@ enditem()
findex(zformat) findex(zformat)
xitem(tt(zformat -f) var(param) var(format) var(specs) ...) xitem(tt(zformat -f) var(param) var(format) var(specs) ...)
item(tt(zformat -a) var(array) var(sep) var(specs) ...)( item(tt(zformat -a) var(array) var(sep) var(specs) ...)(
This builtin provides to different forms of formatting. The first form This builtin provides two different forms of formatting. The first form
is selected with the tt(-f) option. If this is given, the var(format) is selected with the tt(-f) option. In this case the var(format)
string will be modified by replacing sequences starting with a percent string will be modified by replacing sequences starting with a percent
sign in it with strings from the var(specs). Each var(spec) has to be sign in it with strings from the var(specs). Each var(spec) should be
of the form `var(char)tt(:)var(string)' and this will make every of the form `var(char)tt(:)var(string)' which will cause every
appearance of the sequence `tt(%)var(char)' in var(format) be replaced appearance of the sequence `tt(%)var(char)' in var(format) to be replaced
with the var(string). The `tt(%)' sequence may also contain optional by the var(string). The `tt(%)' sequence may also contain optional
minimum and maximum field width specifications between the `tt(%)' and minimum and maximum field width specifications between the `tt(%)' and
the `var(char)' in the form `tt(%)var(min)tt(.)var(max)tt(c)', the `var(char)' in the form `tt(%)var(min)tt(.)var(max)tt(c)',
i.e. the minimum field width is given first and if the maximum field i.e. the minimum field width is given first and if the maximum field
width is used, it has to be preceded by a dot. Giving a minimum field width is used, it has to be preceded by a dot. Specifying a minimum field
width makes the result be padded with spaces to the right if the width makes the result be padded with spaces to the right if the
var(string) is shorter than the requested width. Padding to the left var(string) is shorter than the requested width. Padding to the left
can be achieved by giving a negative minimum field width. If a maximum can be achieved by giving a negative minimum field width. If a maximum
field width is given, the var(string) will be truncated after that field width is specified, the var(string) will be truncated after that
many characters. After all `tt(%)' sequences for the given var(specs) many characters. After all `tt(%)' sequences for the given var(specs)
have been processed, the resulting string is stored in the parameter have been processed, the resulting string is stored in the parameter
var(param). var(param).
The second form, using the tt(-a) option, can be used to get aligned The second form, using the tt(-a) option, can be used for alignin
strings. Here, the var(specs) are of the form strings. Here, the var(specs) are of the form
`var(left)tt(:)var(right)' where `var(left)' and `var(right)' are `var(left)tt(:)var(right)' where `var(left)' and `var(right)' are
arbitrary strings. These strings are modified by replacing the colons arbitrary strings. These strings are modified by replacing the colons
with the var(sep) string and padding the var(left) strings with spaces by the var(sep) string and padding the var(left) strings with spaces
to the right so that the var(sep) strings in the result (and hence the to the right so that the var(sep) strings in the result (and hence the
var(right) strings after them) are all aligned if the strings are var(right) strings after them) are all aligned if the strings are
printed below each other. All strings without a colon are left printed below each other. All strings without a colon are left
unchanged and all strings with a empty var(right) string have the unchanged and all strings with a empty var(right) string have the
trailing colon removed. In both cases the lengths of the strings trailing colon removed. In both cases the lengths of the strings
are not used to determine how the other strings have to be aligned. are not used to determine how the other strings are to be aligned.
The resulting strings are stored in the var(array). The resulting strings are stored in the var(array).
) )
findex(zregexparse) findex(zregexparse)
@ -133,46 +133,51 @@ This implements the internals of the `tt(_regex_arguments)'.
) )
findex(zparseopts) findex(zparseopts)
item(tt(zparseopts) [ tt(-D) ] [ tt(-a) var(array) ] [ tt(-A) var(assoc) ] var(specs))( item(tt(zparseopts) [ tt(-D) ] [ tt(-a) var(array) ] [ tt(-A) var(assoc) ] var(specs))(
This builtin simplifies the parsing of options in the positional This builtin simplifies the parsing of options in positional
parameters. Each var(spec) describes one option and should be of the parameters, i.e. the set of arguments given by tt($*). Each var(spec)
form `var(name)[tt(+)][tt(:)[tt(:)][tt(-)]][tt(=)var(array)]'. The var(name) describes one option and should be of the form
is the name of the option (without the leading `tt(-)'). If only that `var(name)[tt(+)][tt(:)[tt(:)][tt(-)]][tt(=)var(array)]'. The var(name) is
is given, the option takes no argument and if it is found in the the name of the option (without the leading `tt(-)'). If only the option
positional parameters it will be placed in the var(array) given with name is given, the option takes no argument and if it is found in the
the tt(-a) option. If the optional `tt(=)var(array)' is given, it will positional parameters it will be placed in the var(array) specified with
be put into that array instead. If one or two colons are given, the the tt(-a) option; if the optional `tt(=)var(array)' is given, it will
option takes an argument. With one colon, this argument is mandatory instead be put into that array. If one or two colons are given, the
and with two colons it is optional. The argument will be inserted into option takes an argument; with one colon, the argument is mandatory
the var(array), too. For mandatory arguments it is added as a separate and with two colons it is optional. The argument will also be inserted into
string and for optional arguments it is put into one string together the var(array). A mandatory arguments is added as a separate
with the option name unless the `tt(-)' option is given. In this case string and an optional argument is put into a single string together
the argument will be put into the same word even for mandatory with the option name, unless a `tt(-)' appears after the colon, in
which case the argument will be put into the same word even for mandatory
arguments (note that this makes empty strings as arguments arguments (note that this makes empty strings as arguments
indistinguishable). Finally, if the `tt(+)' is given and the option indistinguishable). Finally, if a `tt(+)' appears after var(name) the
appears more than once in the positional parameters, it will be option may appears more than once in the positional parameters and will
inserted more than once in the var(array), too. Without the `tt(+)' hence be inserted more than once in the var(array); without the `tt(+)'
the option will be inserted only once in the var(array) with arguments the option will be inserted only once in the var(array) with arguments
of later options overwriting earlier once. If any of the special of later options overwriting earlier once. Any of the special
character needs to appear in the option name it must be preceded by a characters can appear in the option name provided it is preceded by a
backslash. backslash.
If the tt(-A) option is given, the options and their values will also If the tt(-A) option is given, the options and their values will also
be put into an associative array with the option names as keys and the be put into an associative array with the option names as keys and the
arguments (if any) as the values. Note that it is an error to give arguments (if any) as the values. Note that it is an error to give
var(specs) without a `tt(=)var(array)' and not use either the tt(-a) var(specs) without a `tt(=)var(array)' and not use either the tt(-a)
or tt(-A) option. or tt(-A) option.
If the tt(-D) option is given, all options found are removed from the If the tt(-D) option is given, all options found are removed from the
positional parameters leaving only the strings from the first one that positional parameters, up to but not including any not described by the
was not described by any of the var(specs) to the last (note that this var(specs). This means that any options processed by tt(zparseopts) are
is the usual rule used by tt(zparseopts) to find out when to stop removed from the positional parameters.
processing options).
For example, calling `tt(zparseopts a=foo b:=bar c+:=bar)' with the For example,
strings `tt(-a)', `tt(-bx)', `tt(-c)', `tt(y)', `tt(-cz)', `tt(baz)'
and `tt(-cend)' as positional arguments will set the array tt(foo) to example(set -- -a -bx -c y -cz baz -cend
contain the element `tt(-a)' and the array tt(bar) to the strings zparseopts a=foo b:=bar c+:=bar)
`tt(-b)', `tt(x)', `tt(-c)', `tt(y)', `tt(-c)', and `tt(z)'. The
`tt(baz)' and all strings after it will not be used. will have the effect of
example(foo=(-a)
bar=(-b x -c y -c z))
The arguments from `tt(baz)' on will not be used.
) )
enditem() enditem()

View file

@ -279,7 +279,7 @@ file, but only the basename is used for the remote file name.
With the option tt(-r), if any of the var(files) are directories they are With the option tt(-r), if any of the var(files) are directories they are
sent recursively with all their subdirectories, including files beginning sent recursively with all their subdirectories, including files beginning
with `tt(.)'. This requires that the remote machine understand UNIX file with `tt(.)'. This requires that the remote machine understand UNIX file
semantics. as `tt(/)' is used as a directory separator. semantics, since `tt(/)' is used as a directory separator.
) )
findex(zfuput) findex(zfuput)
item(tt(zfuput [ -vs ] var(file1) ...))( item(tt(zfuput [ -vs ] var(file1) ...))(
@ -367,7 +367,7 @@ var(sess1) and var(sess2) must be distinct.
The operation is performed using pipes, so it is required that the The operation is performed using pipes, so it is required that the
connections still be valid in a subshell, which is not the case under some connections still be valid in a subshell, which is not the case under some
operating systems. versions operating systems, presumably due to a system bug.
) )
enditem() enditem()
@ -376,7 +376,7 @@ The two functions tt(zfmark) and tt(zfgoto) allow you to `bookmark' the
present location (host, user and directory) of the current FTP connection present location (host, user and directory) of the current FTP connection
for later use. The file to be used for storing and retrieving bookmarks is for later use. The file to be used for storing and retrieving bookmarks is
given by the parameter tt($ZFTP_BMFILE); if not set when one of the two given by the parameter tt($ZFTP_BMFILE); if not set when one of the two
functions is called, it will be set to the file tt(.zfbfmarks) in the functions is called, it will be set to the file tt(.zfbkmarks) in the
directory where your zsh startup files live (usually tt(~)). directory where your zsh startup files live (usually tt(~)).
startitem() startitem()
@ -471,7 +471,7 @@ findex(zftp_chpwd, supplied version)
item(tt(zftp_chpwd))( item(tt(zftp_chpwd))(
This function is called every time a connection is opened, or closed, or This function is called every time a connection is opened, or closed, or
the remote directory changes. This version alters the title bar of an the remote directory changes. This version alters the title bar of an
tt(xterm) compatible or tt(sun-cmd) terminal emulator to reflect the tt(xterm)-compatible or tt(sun-cmd) terminal emulator to reflect the
local and remote hostnames and current directories. It works best when local and remote hostnames and current directories. It works best when
combined with the function tt(chpwd). In particular, a function of combined with the function tt(chpwd). In particular, a function of
the form the form