summaryrefslogtreecommitdiffstats
path: root/library/auto.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-06-27 18:19:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-06-27 18:19:06 (GMT)
commitcf9d4634655e69ab161468970a7766f32aca0e53 (patch)
tree9e29c2947f4e9be107cca8551d585a8811355189 /library/auto.tcl
parent13a644cd2e84fcf8837efd67478189c70dd1ed29 (diff)
downloadtcl-cf9d4634655e69ab161468970a7766f32aca0e53.zip
tcl-cf9d4634655e69ab161468970a7766f32aca0e53.tar.gz
tcl-cf9d4634655e69ab161468970a7766f32aca0e53.tar.bz2
* library/auto.tcl: Reverted to Revision 1.12.2.3 (Tcl 8.4.9).
Restores the (buggy) behavior of [auto_reset] that fails to clear away auto-loaded commands from non-global namespaces. Fixing this bug exposed an unknown number of buggy files out there (including at least portions of the Tk script library) that cannot tolerate double [source]-ing. The burden of fixing these exposed bugs will not be forced on package/extension/application authors until Tcl 8.5.
Diffstat (limited to 'library/auto.tcl')
-rw-r--r--library/auto.tcl40
1 files changed, 16 insertions, 24 deletions
diff --git a/library/auto.tcl b/library/auto.tcl
index d251fd0..b02b77f 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.7 2005/06/24 23:13:10 dgp Exp $
+# RCS: @(#) $Id: auto.tcl,v 1.12.2.8 2005/06/27 18:20:26 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -16,27 +16,26 @@
#
# Destroy all cached information for auto-loading and auto-execution,
# so that the information gets recomputed the next time it's needed.
-# Also delete any procedures that are listed in the auto-load index,
-# except some of those defined in the Tcl script library.
+# Also delete any procedures that are listed in the auto-load index
+# except those defined in this file.
#
# Arguments:
# None.
proc auto_reset {} {
- if {[array exists ::auto_index]} {
- foreach cmdName [array names ::auto_index] {
- if {[string match auto_* $cmdName]} {continue}
- set fqcn [namespace which $cmdName]
- if {$fqcn eq ""} {continue}
- if {[catch {info args $fqcn}]} {continue}
- if {[lsearch -exact {
- ::unknown ::pkg_mkIndex ::tclPkgSetup ::tcl_findLibrary
- ::pkg_compareExtension ::tclPkgUnknown ::tcl::MacOSXPkgUnknown
- ::tcl::MacPkgUnknown} $fqcn] != -1} {continue}
- rename $fqcn {}
- }
+ global auto_execs auto_index auto_oldpath
+ foreach p [info procs] {
+ if {[info exists auto_index($p)] && ![string match auto_* $p]
+ && ([lsearch -exact {unknown pkg_mkIndex tclPkgSetup
+ tcl_findLibrary pkg_compareExtension
+ tclPkgUnknown tcl::MacOSXPkgUnknown
+ tcl::MacPkgUnknown} $p] < 0)} {
+ rename $p {}
+ }
}
- unset -nocomplain ::auto_execs ::auto_index ::auto_oldpath
+ catch {unset auto_execs}
+ catch {unset auto_index}
+ catch {unset auto_oldpath}
}
# tcl_findLibrary --
@@ -309,10 +308,7 @@ namespace eval auto_mkindex_parser {
variable scriptFile "" ;# name of file being processed
variable contextStack "" ;# stack of namespace scopes
variable imports "" ;# keeps track of all imported cmds
- variable initCommands ;# list of commands that create aliases
- if {![info exists initCommands]} {
- set initCommands [list]
- }
+ variable initCommands "" ;# list of commands that create aliases
proc init {} {
variable parser
@@ -536,10 +532,6 @@ 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.