From: Jeff Hobbs Date: Fri, 24 Apr 2009 21:16:15 +0000 (+0000) Subject: * tkcon.tcl: override 8.5 [chan puts|gets]. [Bug 1876707] X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=5e61f1efd36b38e421efc386728dcac2a8bdddbd;p=tkcon * tkcon.tcl: override 8.5 [chan puts|gets]. [Bug 1876707] --- diff --git a/ChangeLog b/ChangeLog index 72455c3..56327bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-04-24 Jeff Hobbs + * tkcon.tcl: override 8.5 [chan puts|gets]. [Bug 1876707] + * tkcon.tcl: update pre-8.4 private text binding refs * tkcon.tcl: clean up cmd global var used [Bug 2441583] diff --git a/tkcon.tcl b/tkcon.tcl index fe5dc1a..8ca5115 100755 --- a/tkcon.tcl +++ b/tkcon.tcl @@ -366,9 +366,15 @@ proc ::tkcon::Init {args} { ## input and output is handled by tkcon if {![catch {rename ::puts ::tkcon_tcl_puts}]} { interp alias {} ::puts {} ::tkcon_puts + if {[llength [info commands ::tcl::chan::puts]]} { + interp alias {} ::tcl::chan::puts {} ::tkcon_puts + } } if {($OPT(gets) != "") && ![catch {rename ::gets ::tkcon_tcl_gets}]} { interp alias {} ::gets {} ::tkcon_gets + if {[llength [info commands ::tcl::chan::gets]]} { + interp alias {} ::tcl::chan::gets {} ::tkcon_gets + } } EvalSlave history keep $OPT(history) @@ -483,9 +489,15 @@ proc ::tkcon::InitSlave {slave {slaveargs {}} {slaveargv0 {}}} { foreach cmd $PRIV(slavealias) { $slave alias $cmd $cmd } interp alias $slave ::ls $slave ::dir -full interp alias $slave ::puts $slave ::tkcon_puts + if {[llength [info commands ::tcl::chan::puts]]} { + interp alias $slave ::tcl::chan::puts $slave ::tkcon_puts + } if {$OPT(gets) != ""} { interp eval $slave { catch {rename ::gets ::tkcon_tcl_gets} } interp alias $slave ::gets $slave ::tkcon_gets + if {[llength [info commands ::tcl::chan::gets]]} { + interp alias $slave ::tcl::chan::gets $slave ::tkcon_gets + } } if {$slaveargv0 != ""} { # If tkcon was invoked with 1 or more filenames, then make the @@ -555,6 +567,8 @@ proc ::tkcon::InitInterp {name type} { catch {interp alias {} ::ls {} ::dir -full} if {[catch {interp alias {} ::puts {} ::tkcon_puts}]} { catch {rename ::tkcon_puts ::puts} + } elseif {[llength [info commands ::tcl::chan::puts]]} { + catch {interp alias {} ::tcl::chan::puts {} ::tkcon_puts} } } if {$OPT(gets) != ""} { @@ -562,6 +576,8 @@ proc ::tkcon::InitInterp {name type} { catch {rename ::gets ::tkcon_tcl_gets} if {[catch {interp alias {} ::gets {} ::tkcon_gets}]} { catch {rename ::tkcon_gets ::gets} + } elseif {[llength [info commands ::tcl::chan::gets]]} { + catch {interp alias {} ::tcl::chan::gets {} ::tkcon_gets} } } }