Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Correct the corrections to func.yo
- X-seq: zsh-workers 11483
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Correct the corrections to func.yo
- Date: Mon, 22 May 2000 05:14:17 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
"the flag -U must be created" didn't make much sense.
Emacs' M-q appears to have run amok at one point.
The summary of how fpath searching works was just plain wrong.
A trailing quote got lost (and the whole phrase seemed to fit better in
parentheses anyway).
I also noticed that, in the printed manual, a new paragraph is begun any
time an findex() or cindex() etc. is used. So there are some places in
e.g. jobs.yo that look really awful when printed, because cindex() calls
appear in the middle of sentences. No patch for this yet; should there
be one?
(The reason for that placement of cindex() appears to be to get the page
number right in case the surrounding paragraph crosses a page boundary.
This is irrelevant to HTML and info, where the output looks fine; so we
appear to have a choice between stupid-looking accuracy or intelligent-
looking inaccuracy.)
Index: Doc/Zsh/func.yo
===================================================================
@@ -45,7 +45,7 @@
tt(autoload) builtin or its equivalent is given the option tt(-U). This is
recommended for the use of functions supplied with the zsh distribution.
Note that for functions precompiled with the tt(zcompile) builtin command
-the flag tt(-U) must be created when the tt(.zwc) file is created, as the
+the flag tt(-U) must be provided when the tt(.zwc) file is created, as the
corresponding information is compiled into the latter.
For each var(element) in tt(fpath), the shell looks for three possible
@@ -67,20 +67,25 @@
without the suffix. Thus including an element such as
`tt(/usr/local/funcs.zwc)' in tt(fpath) will speed up the search for
functions, with the disadvantage that functions included must be explicitly
-recompiled by hand before the shell notices any changes. )
-item(var(element)tt(/)var(function)tt(.zwc))( A file created with
-tt(zcompile), which is expected to contain the definition for
-var(function). It may include other function definitions as well, but
-those are neither loaded nor executed; a file found in this way is searched
-em(only) for the definition of var(function). )
-item(var(element)tt(/)var(function))( A file of zsh command text, taken to
-be the definition for var(function). ) enditem()
-
-In summary, the order of searching is, first, directories in tt(fpath),
-with the earliest directory containing a function definition being used;
-within that directory, the newest of the three possibilities --- a compiled
-directory, a compiled function, or an ordinary function defition --- is
-used.
+recompiled by hand before the shell notices any changes.
+)
+item(var(element)tt(/)var(function)tt(.zwc))(
+A file created with tt(zcompile), which is expected to contain the
+definition for var(function). It may include other function definitions
+as well, but those are neither loaded nor executed; a file found in this
+way is searched em(only) for the definition of var(function).
+)
+item(var(element)tt(/)var(function))(
+A file of zsh command text, taken to be the definition for var(function).
+)
+enditem()
+
+In summary, the order of searching is, first, in the em(parents of)
+directories in tt(fpath) for the newer of either a compiled directory or
+a directory in tt(fpath); second, if more than one of these contains a
+definition for the function that is sought, the leftmost in the tt(fpath)
+is chosen; and third, within a directory, the newer of either a compiled
+function or an ordinary function definition is used.
pindex(KSH_AUTOLOAD, use of)
If the tt(KSH_AUTOLOAD) option is set, or the file contains only a
@@ -90,8 +95,8 @@
and may therefore define local parameters. It is an error if the function
is not defined by loading the file.
-Otherwise, the function body with no surrounding `var(funcname)tt(()
-{)var(...)tt(}) is taken to be the complete contents of the file. This
+Otherwise, the function body (with no surrounding `var(funcname)tt(()
+{)var(...)tt(})') is taken to be the complete contents of the file. This
form allows the file to be used directly as an executable shell script. If
processing of the file results in the function being re-defined, the
function itself is not re-executed. To force the shell to perform
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author