diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/library.n | 15 | ||||
-rw-r--r-- | library/auto.tcl | 5 | ||||
-rw-r--r-- | library/init.tcl | 20 |
4 files changed, 21 insertions, 25 deletions
@@ -1,3 +1,9 @@ +2004-06-16 Don Porter <dgp@users.sourceforge.net> + + * doc/library.n: Moved variables ::auto_oldpath and + * library/auto.tcl: ::unknown_pending into ::tcl namespace. + * library/init.tcl: [Bugs 808319, 948794] + 2004-06-15 Donal K. Fellows <donal.k.fellows@man.ac.uk> * doc/binary.n: Added some notes to the documentation of the 'a' diff --git a/doc/library.n b/doc/library.n index be62777..8845ef8 100644 --- a/doc/library.n +++ b/doc/library.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: library.n,v 1.16 2001/08/24 06:03:15 dgp Exp $ +'\" RCS: @(#) $Id: library.n,v 1.17 2004/06/16 21:20:42 dgp Exp $ .so man.macros .TH library n "8.0" Tcl "Tcl Built-In Commands" .BS @@ -22,13 +22,11 @@ auto_execok, auto_import, auto_load, auto_mkindex, auto_mkindex_old, auto_qualif \fBauto_reset\fR \fBtcl_findLibrary \fIbasename version patch initScript enVarName varName\fR \fBparray \fIarrayName\fR -.VS \fBtcl_endOfWord \fIstr start\fR \fBtcl_startOfNextWord \fIstr start\fR \fBtcl_startOfPreviousWord \fIstr start\fR \fBtcl_wordBreakAfter \fIstr start\fR \fBtcl_wordBreakBefore \fIstr start\fR -.VE .BE .SH INTRODUCTION @@ -197,7 +195,6 @@ in the array \fIarrayName\fR. It may be either local or global. .TP \fBtcl_endOfWord \fIstr start\fR -.VS Returns the index of the first end-of-word location that occurs after a starting index \fIstart\fR in the string \fIstr\fR. An end-of-word location is defined to be the first non-word character following the @@ -233,7 +230,6 @@ Returns the index of the first word boundary before the starting index boundaries before the starting point in the given string. The index returned refers to the second character of the pair that comprises a boundary. -.VE .SH "VARIABLES" .PP @@ -279,7 +275,6 @@ Tcl format, using "/" as the path separator, regardless of platform. This variable is only used when initializing the \fBauto_path\fR variable. .TP \fBtcl_nonwordchars\fR -.VS This variable contains a regular expression that is used by routines like \fBtcl_endOfWord\fR to identify whether a character is part of a word or not. If the pattern matches a character, the character is @@ -295,14 +290,6 @@ word or not. If the pattern matches a character, the character is considered to be a word character. On Windows platforms, words are comprised of any character that is not a space, tab, or newline. Under Unix, words are comprised of numbers, letters or underscores. -.VE -.TP -\fBunknown_pending\fR -Used by \fBunknown\fR to record the command(s) for which it is -searching. -It is used to detect errors where \fBunknown\fR recurses on itself -infinitely. -The variable is unset before \fBunknown\fR returns. .SH "SEE ALSO" info(n), re_syntax(n) diff --git a/library/auto.tcl b/library/auto.tcl index c1bf77d..0f0cb58 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.15 2004/03/17 18:14:14 das Exp $ +# RCS: @(#) $Id: auto.tcl,v 1.16 2004/06/16 21:20:42 dgp Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1998 Sun Microsystems, Inc. @@ -23,7 +23,8 @@ # None. proc auto_reset {} { - global auto_execs auto_index auto_oldpath + variable ::tcl::auto_oldpath + global auto_execs auto_index foreach p [info procs] { if {[info exists auto_index($p)] && ![string match auto_* $p] && ([lsearch -exact {unknown pkg_mkIndex tclPkgSetup diff --git a/library/init.tcl b/library/init.tcl index d4002da..21b3377 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -3,7 +3,7 @@ # Default system startup file for Tcl-based applications. Defines # "unknown" procedure and auto-load facilities. # -# RCS: @(#) $Id: init.tcl,v 1.62 2004/06/11 21:30:08 dgp Exp $ +# RCS: @(#) $Id: init.tcl,v 1.63 2004/06/16 21:20:42 dgp Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -164,7 +164,8 @@ if {[llength [info commands tclLog]] == 0} { # command, including the command name. proc unknown args { - global auto_noexec auto_noload env unknown_pending tcl_interactive + variable ::tcl::UnknownPending + global auto_noexec auto_noload env tcl_interactive global errorCode errorInfo # If the command word has the form "namespace inscope ns cmd" @@ -192,18 +193,18 @@ proc unknown args { # # Make sure we're not trying to load the same proc twice. # - if {[info exists unknown_pending($name)]} { + if {[info exists UnknownPending($name)]} { return -code error "self-referential recursion in \"unknown\" for command \"$name\""; } - set unknown_pending($name) pending; + set UnknownPending($name) pending; set ret [catch {auto_load $name [uplevel 1 {::namespace current}]} msg] - unset unknown_pending($name); + unset UnknownPending($name); if {$ret != 0} { append errorInfo "\n (autoloading \"$name\")" return -code $ret -errorcode $errorCode -errorinfo $errorInfo $msg } - if {![array size unknown_pending]} { - unset unknown_pending + if {![array size UnknownPending]} { + unset UnknownPending } if {$msg} { set errorCode $savedErrorCode @@ -338,7 +339,7 @@ proc unknown args { # for instance. If not given, namespace current is used. proc auto_load {cmd {namespace {}}} { - global auto_index auto_oldpath auto_path + global auto_index auto_path if {[string length $namespace] == 0} { set namespace [uplevel 1 [list ::namespace current]] @@ -390,7 +391,8 @@ proc auto_load {cmd {namespace {}}} { # None. proc auto_load_index {} { - global auto_index auto_oldpath auto_path errorInfo errorCode + variable ::tcl::auto_oldpath + global auto_index auto_path errorInfo errorCode if {[info exists auto_oldpath] && \ [string equal $auto_oldpath $auto_path]} { |