summaryrefslogtreecommitdiff
path: root/tcl/doc/pkgMkIndex.n
diff options
context:
space:
mode:
authorIan Roxborough <irox@redhat.com>2001-09-09 22:40:53 +0000
committerIan Roxborough <irox@redhat.com>2001-09-09 22:40:53 +0000
commita850c17c374d03259483e799b09326d255e17487 (patch)
treef1d024951a993f0453aa49d4ba808d6c38fa4321 /tcl/doc/pkgMkIndex.n
parent57e8350a3895a1579b77cc134d6d7d49b056678e (diff)
downloadgdb-a850c17c374d03259483e799b09326d255e17487.tar.gz
Tcl 8.3 upgradeTCL_8_3
Diffstat (limited to 'tcl/doc/pkgMkIndex.n')
-rw-r--r--tcl/doc/pkgMkIndex.n81
1 files changed, 39 insertions, 42 deletions
diff --git a/tcl/doc/pkgMkIndex.n b/tcl/doc/pkgMkIndex.n
index 71683e48f4c..9980d108296 100644
--- a/tcl/doc/pkgMkIndex.n
+++ b/tcl/doc/pkgMkIndex.n
@@ -7,15 +7,15 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH pkg_mkIndex n 8.0 Tcl "Tcl Built-In Commands"
+.TH pkg_mkIndex n 8.3 Tcl "Tcl Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
pkg_mkIndex \- Build an index for automatic loading of packages
.SH SYNOPSIS
.nf
-.VS 8.0.3
-\fBpkg_mkIndex ?\fI-direct\fR? ?\fI-load pkgPat\fR? ?\fI-verbose\fR? \fIdir\fR ?\fIpattern pattern ...\fR?
+.VS 8.3.0
+\fBpkg_mkIndex ?\fI\-lazy\fR? ?\fI\-load pkgPat\fR? ?\fI\-verbose\fR? \fIdir\fR ?\fIpattern pattern ...\fR?
.VE
.fi
.BE
@@ -43,28 +43,8 @@ The \fIdir\fR argument gives the name of a directory and each
script or binary files in \fIdir\fR.
.VS 8.0.3
The default pattern is \fB*.tcl\fR and \fB*.[info sharedlibextension]\fR.
-The optional switches are:
-.TP 15
-\fB\-direct\fR
-The generated index
-will manage to load the package immediately upon \fBpackage require\fR
-instead of delaying loading until actual use of one of the commands.
-.TP 15
-\fB\-load \fIpkgPat\fR
-The index process will pre-load any packages that exist in the
-current interpreter and match \fIpkgPat\fP into the slave interpreter used to
-generate the index. The pattern match uses string match rules.
-See COMPLEX CASES below.
-.TP 15
-\fB\-verbose\fR
-Generate output during the indexing process. Output is via
-the \fBtclLog\fP procedure, which by default prints to stderr.
-.TP 15
-\fB\-\-\fR
-End of the flags, in case \fIdir\fP begins with a dash.
.VE
-.LP
-.RS
+.br
\fBPkg_mkIndex\fR will create a file \fBpkgIndex.tcl\fR in \fIdir\fR
with package information about all the files given by the \fIpattern\fR
arguments.
@@ -75,10 +55,10 @@ and new commands appear (this is why it is essential to have
in the files, as described above).
If you have a package split among scripts and binary files,
or if you have dependencies among files,
-you may have to use the \fB-load\fP option
+you may have to use the \fB\-load\fP option
or adjust the order in which \fBpkg_mkIndex\fR processes
the files. See COMPLEX CASES below.
-.RE
+
.IP [3]
Install the package as a subdirectory of one of the directories given by
the \fBtcl_pkgPath\fR variable. If \fB$tcl_pkgPath\fR contains more
@@ -92,7 +72,7 @@ the package's script and/or binary files as well as the \fBpkgIndex.tcl\fR
file. As long as the package is installed as a subdirectory of a
directory in \fB$tcl_pkgPath\fR it will automatically be found during
\fBpackage require\fR commands.
-.IP
+.br
If you install the package anywhere else, then you must ensure that
the directory containing the package is in the \fBauto_path\fR global variable
or an immediate subdirectory of one of the directories in \fBauto_path\fR.
@@ -119,6 +99,27 @@ interpreter, based on the first call to \fBpackage require\fR.
Different versions of a package may be loaded in different
interpreters.
+.SH OPTIONS
+The optional switches are:
+.TP 15
+\fB\-lazy\fR
+The generated index will manage to delay loading the package until the
+use of one of the commands provided by the package, instead of loading
+it immediately upon \fBpackage require\fR.
+.TP 15
+\fB\-load \fIpkgPat\fR
+The index process will pre-load any packages that exist in the
+current interpreter and match \fIpkgPat\fP into the slave interpreter used to
+generate the index. The pattern match uses string match rules.
+See COMPLEX CASES below.
+.TP 15
+\fB\-verbose\fR
+Generate output during the indexing process. Output is via
+the \fBtclLog\fP procedure, which by default prints to stderr.
+.TP 15
+\fB\-\-\fR
+End of the flags, in case \fIdir\fP begins with a dash.
+
.SH "PACKAGES AND THE AUTO-LOADER"
.PP
The package management facilities overlap somewhat with the auto-loader,
@@ -153,30 +154,26 @@ commands for each version of each available package; these commands
invoke \fBpackage provide\fR commands to announce the
availability of the package, and they setup auto-loader
information to load the files of the package.
-.VS 8.0.3
-Unless the \fI-direct\fR flag was provided when the \fBpkgIndex.tcl\fR
+.VS 8.3
+If the \fI\-lazy\fR flag was provided when the \fBpkgIndex.tcl\fR
was generated,
.VE
a given file of a given version of a given package isn't
actually loaded until the first time one of its commands
is invoked.
-Thus, after invoking \fBpackage require\fR you
-.VS 8.0.3
-may
-.VE
-not see
-the package's commands in the interpreter, but you will be able
+Thus, after invoking \fBpackage require\fR you may
+not see the package's commands in the interpreter, but you will be able
to invoke the commands and they will be auto-loaded.
-.VS 8.0.3
+.VS 8.3
.SH "DIRECT LOADING"
.PP
Some packages, for instance packages which use namespaces and export
commands or those which require special initialization, might select
that their package files be loaded immediately upon \fBpackage require\fR
instead of delaying the actual loading to the first use of one of the
-package's command. This mode is enabled when generating the package
-index by specifying the \fI-direct\fR argument.
+package's command. This is the default mode when generating the package
+index. It can be overridden by specifying the \fI\-lazy\fR argument.
.VE
.SH "COMPLEX CASES"
@@ -210,7 +207,7 @@ For example, suppose the BLT package requires Tk, and expresses
this with a call to \fBTcl_PkgRequire\fP in its \fBBlt_Init\fP routine.
To support this, you must run \fBpkg_mkIndex\fR in an interpreter that
has Tk loaded. You can achieve this with the
-\fB-load \fIpkgPat\fR option. If you specify this option,
+\fB\-load \fIpkgPat\fR option. If you specify this option,
\fBpkg_mkIndex\fR will load any packages listed by
\fBinfo loaded\fP and that match \fIpkgPat\fP
into the interpreter used to process files.
@@ -224,14 +221,14 @@ and then the package it provides
will be available when the second file is processed.
You may also need to load the first package into the
temporary interpreter used to create the index by using
-the \fB-load\fP flag;
+the \fB\-load\fP flag;
it won't hurt to specify package patterns that are not yet loaded.
.PP
If you have a package that is split across scripts and a binary file,
-then you should avoid the \fB-load\fP flag. The problem is that
+then you should avoid the \fB\-load\fP flag. The problem is that
if you load a package before computing the index it masks any
other files that provide part of the same package.
-If you must use \fB-load\fP,
+If you must use \fB\-load\fP,
then you must specify the scripts first; otherwise the package loaded from
the binary file may mask the package defined by the scripts.