summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-23 09:46:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-03-23 09:46:40 (GMT)
commitdd51d2a558130e83507305911b8be44c57da3747 (patch)
treeec81cf655e874570eeb665168ad3c6f2587c103f
parent9ac95b002e2b6c6b66c04d1964c22ccc25d4e883 (diff)
parentf16557b5a03c04972b0b35eef114e92d2195e529 (diff)
downloadtcl-dd51d2a558130e83507305911b8be44c57da3747.zip
tcl-dd51d2a558130e83507305911b8be44c57da3747.tar.gz
tcl-dd51d2a558130e83507305911b8be44c57da3747.tar.bz2
Fix [f1253530cdd83e66]: tcl_wordchars and tcl_nonwordchars are unknown at startup.
For trunk this will not be the complete story, but for core-8-6-branch and core-8-5-branch it will at least make tcl_wordchars and tcl_nonwordchars function as documented. That's the least polish we should do. See: [https://groups.google.com/forum/#!topic/comp.lang.tcl/ZZ_WwfQdmoE]. People like Eric Brunel, who want the most logical behavior for any Tcl release can simply do: set ::tcl_wordchars {\w} set ::tcl_nonwordchars {\W}
-rw-r--r--library/word.tcl16
1 files changed, 12 insertions, 4 deletions
diff --git a/library/word.tcl b/library/word.tcl
index b8f34a5..3e4bc3a 100644
--- a/library/word.tcl
+++ b/library/word.tcl
@@ -15,12 +15,20 @@
if {$::tcl_platform(platform) eq "windows"} {
# Windows style - any but a unicode space char
- set ::tcl_wordchars {\S}
- set ::tcl_nonwordchars {\s}
+ if {![info exists ::tcl_wordchars]} {
+ set ::tcl_wordchars {\S}
+ }
+ if {![info exists ::tcl_nonwordchars]} {
+ set ::tcl_nonwordchars {\s}
+ }
} else {
# Motif style - any unicode word char (number, letter, or underscore)
- set ::tcl_wordchars {\w}
- set ::tcl_nonwordchars {\W}
+ if {![info exists ::tcl_wordchars]} {
+ set ::tcl_wordchars {\w}
+ }
+ if {![info exists ::tcl_nonwordchars]} {
+ set ::tcl_nonwordchars {\W}
+ }
}
# Arrange for caches of the real matcher REs to be kept, which enables the REs