summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-06-24 23:13:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-06-24 23:13:10 (GMT)
commit8cd33b52416f2fe2176bf5a616770ee521dbff99 (patch)
treea8fba6818fe7c863969211bc8e5e29f86691aeb4
parent8f7acc02bcd8a64423e1652bcb5f43f8615ddf8d (diff)
downloadtcl-8cd33b52416f2fe2176bf5a616770ee521dbff99.zip
tcl-8cd33b52416f2fe2176bf5a616770ee521dbff99.tar.gz
tcl-8cd33b52416f2fe2176bf5a616770ee521dbff99.tar.bz2
* library/auto.tcl: Make file safe to re-[source] without
destroying registered auto_mkindex_parser hooks.
-rw-r--r--library/auto.tcl46
1 files changed, 23 insertions, 23 deletions
diff --git a/library/auto.tcl b/library/auto.tcl
index 35ce6f2..d251fd0 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl dealing with auto execution
# of commands and can be auto loaded themselves.
#
-# RCS: @(#) $Id: auto.tcl,v 1.12.2.6 2005/06/24 15:02:25 dgp Exp $
+# RCS: @(#) $Id: auto.tcl,v 1.12.2.7 2005/06/24 23:13:10 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -536,6 +536,28 @@ proc auto_mkindex_parser::fullname {name} {
return $name
}
+if {[llength $::auto_mkindex_parser::initCommands]} {
+ return
+}
+
+# Register all of the procedures for the auto_mkindex parser that
+# will build the "tclIndex" file.
+
+# AUTO MKINDEX: proc name arglist body
+# Adds an entry to the auto index list for the given procedure name.
+
+auto_mkindex_parser::command proc {name args} {
+ variable index
+ variable scriptFile
+ # Do some fancy reformatting on the "source" call to handle platform
+ # differences with respect to pathnames. Use format just so that the
+ # command is a little easier to read (otherwise it'd be full of
+ # backslashed dollar signs, etc.
+ append index [list set auto_index([fullname $name])] \
+ [format { [list source [file join $dir %s]]} \
+ [file split $scriptFile]] "\n"
+}
+
# Conditionally add support for Tcl byte code files. There are some
# tricky details here. First, we need to get the tbcload library
# initialized in the current interpreter. We cannot load tbcload into the
@@ -569,28 +591,6 @@ auto_mkindex_parser::hook {
}
}
-if {[llength $::auto_mkindex_parser::initCommands]} {
- return
-}
-
-# Register all of the procedures for the auto_mkindex parser that
-# will build the "tclIndex" file.
-
-# AUTO MKINDEX: proc name arglist body
-# Adds an entry to the auto index list for the given procedure name.
-
-auto_mkindex_parser::command proc {name args} {
- variable index
- variable scriptFile
- # Do some fancy reformatting on the "source" call to handle platform
- # differences with respect to pathnames. Use format just so that the
- # command is a little easier to read (otherwise it'd be full of
- # backslashed dollar signs, etc.
- append index [list set auto_index([fullname $name])] \
- [format { [list source [file join $dir %s]]} \
- [file split $scriptFile]] "\n"
-}
-
# AUTO MKINDEX: namespace eval name command ?arg arg...?
# Adds the namespace name onto the context stack and evaluates the
# associated body of commands.