Browse Source

whitespace (end of line) fixes and fconfigure->chan configure fileevent->chan event, minor expr tweaks

master
Julian Noble 1 month ago
parent
commit
fe03c0652b
  1. 8
      src/modules/#modpod-zipper-999999.0a1.0/zipper-999999.0a1.0.tm
  2. 13
      src/modules/punk-0.1.tm
  3. 4
      src/modules/punk/ansi-999999.0a1.0.tm
  4. 44
      src/modules/punk/basictelnet-999999.0a1.0.tm
  5. 2
      src/modules/punk/cap/handlers/templates-999999.0a1.0.tm
  6. 2
      src/modules/punk/char-999999.0a1.0.tm
  7. 2
      src/modules/punk/config-0.1.tm
  8. 4
      src/modules/punk/console-999999.0a1.0.tm
  9. 13
      src/modules/punk/fileline-999999.0a1.0.tm
  10. 30
      src/modules/punk/icomm-999999.0a1.0.tm
  11. 24
      src/modules/punk/lib-999999.0a1.0.tm
  12. 24
      src/modules/punk/repl-999999.0a1.0.tm
  13. 4
      src/modules/punk/sshrun-999999.0a1.0.tm
  14. 14
      src/modules/punk/winrun-999999.0a1.0.tm
  15. 2
      src/modules/punkcheck-0.1.0.tm
  16. 11
      src/modules/shellrun-0.1.1.tm
  17. 12
      src/modules/shellthread-1.6.1.tm
  18. 6
      src/modules/textblock-999999.0a1.0.tm

8
src/modules/#modpod-zipper-999999.0a1.0/zipper-999999.0a1.0.tm

@ -31,8 +31,8 @@ namespace eval zipper {
set v::fd $fd set v::fd $fd
set v::base [tell $fd] set v::base [tell $fd]
set v::toc {} set v::toc {}
#fconfigure $fd -translation binary -encoding binary #chan configure $fd -translation binary -encoding binary
fconfigure $fd -translation binary -encoding iso8859-1 chan configure $fd -translation binary -encoding iso8859-1
} }
proc emit {s} { proc emit {s} {
@ -150,7 +150,7 @@ namespace eval zipper {
set len [expr {$cd_end_pos - $cd_start_pos}] set len [expr {$cd_end_pos - $cd_start_pos}]
#incr pos -$v::base #incr pos -$v::base
set cdr_offset_pos [expr $cd_start_pos -$v::base] ;#review set cdr_offset_pos [expr {$cd_start_pos -$v::base}] ;#review
#EOCD signature PK\5\6 = 0x06054b50 #EOCD signature PK\5\6 = 0x06054b50
emit [binary format a2c2ssssiis PK {5 6} 0 0 $ntoc $ntoc $len $cdr_offset_pos 0] emit [binary format a2c2ssssiis PK {5 6} 0 0 $ntoc $ntoc $len $cdr_offset_pos 0]
@ -178,7 +178,7 @@ if {[info exists argv0] && [string match zipper-* [file tail $argv0]]} {
if {[file isfile $f]} { if {[file isfile $f]} {
regsub {^\./} $f {} f regsub {^\./} $f {} f
set fd [open $f] set fd [open $f]
fconfigure $fd -translation binary -encoding binary chan configure $fd -translation binary -encoding binary
zipper::addentry $f [read $fd] [file mtime $f] zipper::addentry $f [read $fd] [file mtime $f]
close $fd close $fd
} elseif {[file isdir $f]} { } elseif {[file isdir $f]} {

13
src/modules/punk-0.1.tm

@ -1234,7 +1234,7 @@ namespace eval punk {
break break
} }
#leave the - from the end- as part of the offset #leave the - from the end- as part of the offset
set offset [expr $endspec] ;#don't brace! set offset [expr $endspec] ;#don't brace! (consider: set x --34;puts expr $j;puts expr {$j} )
if {$do_bounds_check && ($offset > 0 || abs($offset) >= $len)} { if {$do_bounds_check && ($offset > 0 || abs($offset) >= $len)} {
set action ?mismatch-list-index-out-of-range set action ?mismatch-list-index-out-of-range
break break
@ -3690,7 +3690,8 @@ namespace eval punk {
#todo - some way to restrict mismatch info to simple "mismatch" and avoid overhead of verbose message #todo - some way to restrict mismatch info to simple "mismatch" and avoid overhead of verbose message
#e.g for within pipeswitch block where mismatches are expected and the reasons are less important than moving on quickly #e.g for within pipeswitch block where mismatches are expected and the reasons are less important than moving on quickly
set vidx 0 set vidx 0
set mismatches [lmap m $match_state v $var_names {expr {$m == 0} ? {[list mismatch $v]} : {[list match $v]}}] #set mismatches [lmap m $match_state v $var_names {expr {$m == 0} ? {[list mismatch $v]} : {[list match $v]}}]
set mismatches [lmap m $match_state v $var_names {expr {$m == 0 ? [list mismatch $v] : [list match $v]}}]
set var_display_names [list] set var_display_names [list]
foreach v $var_names { foreach v $var_names {
if {$v eq ""} { if {$v eq ""} {
@ -3699,7 +3700,9 @@ namespace eval punk {
lappend var_display_names $v lappend var_display_names $v
} }
} }
set mismatches_display [lmap m $match_state v $var_display_names {expr {$m == 0} ? {$v} : {[expr {$m eq "?"} ? {"?[string repeat { } [expr [string length $v] -1]]"} : {[string repeat " " [string length $v]]} ]}}] #REVIEW 2025
#set mismatches_display [lmap m $match_state v $var_display_names {expr {$m == 0} ? {$v} : {[expr {$m eq "?"} ? {"?[string repeat { } [expr [string length $v] -1]]"} : {[string repeat " " [string length $v]]} ]}}]
set mismatches_display [lmap m $match_state v $var_display_names {expr {$m == 0 ? $v : [expr {$m eq "?" ? "?[string repeat { } [expr {[string length $v] -1}]]" : [string repeat " " [string length $v]] }]}}]
set msg "\n" set msg "\n"
append msg "Unmatched\n" append msg "Unmatched\n"
append msg "Cannot match right hand side to pattern $multivar\n" append msg "Cannot match right hand side to pattern $multivar\n"
@ -5304,6 +5307,8 @@ namespace eval punk {
##if {$body ni $existing} { ##if {$body ni $existing} {
set scr [base64::encode -maxlen 0 $cond] ;#will only be decoded if the debug is triggered set scr [base64::encode -maxlen 0 $cond] ;#will only be decoded if the debug is triggered
#tcllib has some double-substitution going on.. base64 seems easiest and will not impact the speed of normal execution when debug off. #tcllib has some double-substitution going on.. base64 seems easiest and will not impact the speed of normal execution when debug off.
#tclint-disable-next-line
proc ::unknown {args} [string map [list @c@ $cond @b@ $body @scr@ $scr] { proc ::unknown {args} [string map [list @c@ $cond @b@ $body @scr@ $scr] {
#--------------------------------------- #---------------------------------------
if {![catch {expr {@c@}} res] && $res} { if {![catch {expr {@c@}} res] && $res} {
@ -5368,7 +5373,7 @@ namespace eval punk {
#for var="val {a b c}" #for var="val {a b c}"
#proc ::punk::val {{v {}}} {tailcall lindex $v} #proc ::punk::val {{v {}}} {tailcall lindex $v}
#proc ::punk::val {{v {}}} {return $v} ;#2023 - approx 2x faster than the tailcall lindex version #proc ::punk::val {{v {}}} {return $v} ;#2023 - approx 2x faster than the tailcall lindex version
#tclint-disable-next-line
proc ::punk::val [list [list v [purelist]]] {return $v} proc ::punk::val [list [list v [purelist]]] {return $v}
#---------------- #----------------

4
src/modules/punk/ansi-999999.0a1.0.tm

@ -7569,11 +7569,11 @@ namespace eval punk::ansi::colour {
} }
foreach c {R G B} { foreach c {R G B} {
if {$T($c) < [expr {1.0/6.0}]} { if {$T($c) < (1.0/6.0)} {
set T($c) [expr {$P+($Q-$P)*6.0*$T($c)}] set T($c) [expr {$P+($Q-$P)*6.0*$T($c)}]
} elseif {$T($c) < 0.5} { } elseif {$T($c) < 0.5} {
set T($c) $Q set T($c) $Q
} elseif {$T($c) < [expr {2.0/3.0}]} { } elseif {$T($c) < (2.0/3.0)} {
set T($c) [expr {$P+($Q-$P)*(2.0/3.0-$T($c))*6.0}] set T($c) [expr {$P+($Q-$P)*(2.0/3.0-$T($c))*6.0}]
} else { } else {
set T($c) $P set T($c) $P

44
src/modules/punk/basictelnet-999999.0a1.0.tm

@ -402,7 +402,7 @@ namespace eval punk::basictelnet {
set client_declined "CLI-WONT:[a+ red bold][get_client_option_declined_summary][a]" set client_declined "CLI-WONT:[a+ red bold][get_client_option_declined_summary][a]"
set info $server_summary\n$client_summary\n$client_declined\n$info set info $server_summary\n$client_summary\n$client_declined\n$info
#set existing_handler [fileevent stdin readable] #set existing_handler [chan event stdin readable]
set RST "\x1b\[m" set RST "\x1b\[m"
set debug_width 80 set debug_width 80
@ -412,12 +412,12 @@ namespace eval punk::basictelnet {
#puts -nonewline [punk::ansi::cursor_off] #puts -nonewline [punk::ansi::cursor_off]
#use non cursorsave version - slower - but less likely to interfere with cursor operations in data #use non cursorsave version - slower - but less likely to interfere with cursor operations in data
set existing_input_handler [fileevent $inputchannel readable] ;#stdin set existing_input_handler [chan event $inputchannel readable] ;#stdin
fileevent $inputchannel readable {} chan event $inputchannel readable {}
if {[string length $outputchannel]} { if {[string length $outputchannel]} {
set existing_output_handler [fileevent $outputchannel readable] ;#sock set existing_output_handler [chan event $outputchannel readable] ;#sock
fileevent $outputchannel readable {} chan event $outputchannel readable {}
} }
if {[catch { if {[catch {
@ -434,9 +434,9 @@ namespace eval punk::basictelnet {
#todo - try? finally? #todo - try? finally?
set writing_debug_frame 0 set writing_debug_frame 0
fileevent $inputchannel readable $existing_input_handler chan event $inputchannel readable $existing_input_handler
if {[string length $outputchannel]} { if {[string length $outputchannel]} {
fileevent $outputchannel readable $existing_output_handler chan event $outputchannel readable $existing_output_handler
} }
return return
} }
@ -529,13 +529,13 @@ namespace eval punk::basictelnet {
#todo - allow telnet with channels other than stdin/stdout - and multiple sessions - per session option_states #todo - allow telnet with channels other than stdin/stdout - and multiple sessions - per session option_states
reset_option_states reset_option_states
set sock [socket $server $port] set sock [socket $server $port]
#fconfigure $sock -buffering none -blocking 0 -encoding binary -translation crlf -eofchar {} #chan configure $sock -buffering none -blocking 0 -encoding binary -translation crlf -eofchar {}
#fconfigure $sock -buffering none -blocking 0 -encoding binary -translation binary -eofchar {} #chan configure $sock -buffering none -blocking 0 -encoding binary -translation binary -eofchar {}
fconfigure $sock -buffering none -blocking 0 -encoding iso8859-1 -translation binary -eofchar {} chan configure $sock -buffering none -blocking 0 -encoding iso8859-1 -translation binary -eofchar {}
fconfigure stdout -buffering none chan configure stdout -buffering none
fileevent $sock readable [list [namespace current]::fromServer $sock] chan event $sock readable [list [namespace current]::fromServer $sock]
chan configure stdin -blocking 0 chan configure stdin -blocking 0
fileevent stdin readable [list [namespace current]::toServer $sock] chan event stdin readable [list [namespace current]::toServer $sock]
variable closed variable closed
vwait ::punk::basictelnet::closed($sock) vwait ::punk::basictelnet::closed($sock)
unset closed($sock) unset closed($sock)
@ -568,7 +568,7 @@ namespace eval punk::basictelnet {
set input_chunks_waiting(stdin) [lrange $input_chunks_waiting(stdin) 1 end] set input_chunks_waiting(stdin) [lrange $input_chunks_waiting(stdin) 1 end]
} }
fileevent stdin readable {} chan event stdin readable {}
if {$nextwaiting eq ""} { if {$nextwaiting eq ""} {
set chunk [read stdin] set chunk [read stdin]
} else { } else {
@ -616,13 +616,13 @@ namespace eval punk::basictelnet {
#Re-enable channel read handler only if no waiting chunks - must process in order #Re-enable channel read handler only if no waiting chunks - must process in order
################################################################################## ##################################################################################
if {![llength $input_chunks_waiting(stdin)]} { if {![llength $input_chunks_waiting(stdin)]} {
fileevent stdin readable [list [namespace current]::toServer $sock] chan event stdin readable [list [namespace current]::toServer $sock]
} else { } else {
#after idle [list [namespace current]::toServer $sock] #after idle [list [namespace current]::toServer $sock]
tailcall [namespace current]::toServer $sock tailcall [namespace current]::toServer $sock
} }
#################################################### ####################################################
#fileevent stdin readable [list [namespace current]::toServer $sock] #chan event stdin readable [list [namespace current]::toServer $sock]
} else { } else {
disconnect sock disconnect sock
} }
@ -642,7 +642,7 @@ namespace eval punk::basictelnet {
variable encoding_guess variable encoding_guess
variable debug variable debug
variable fromserver_unprocessed variable fromserver_unprocessed
fileevent $sock readable {} chan event $sock readable {}
variable in_sb variable in_sb
set chunksize 4096 ;#No choice of chunksize can avoid the possibility of splitting a token such as a Telnet protocol command or an ANSI sequence. set chunksize 4096 ;#No choice of chunksize can avoid the possibility of splitting a token such as a Telnet protocol command or an ANSI sequence.
#in theory, a split ANSI sequence won't cause a problem - except if we have debug on which could emit a request on stdout (e.g get_cursor_pos) #in theory, a split ANSI sequence won't cause a problem - except if we have debug on which could emit a request on stdout (e.g get_cursor_pos)
@ -872,24 +872,24 @@ namespace eval punk::basictelnet {
#after idle [list fileevent $sock readable [list [namespace current]::fromServer $sock]] #after idle [list chan event $sock readable [list [namespace current]::fromServer $sock]]
if {[string length $fromserver_unprocessed]} { if {[string length $fromserver_unprocessed]} {
#review - by throwing to another loop without waiting for readable event - we could spin on same data...? #review - by throwing to another loop without waiting for readable event - we could spin on same data...?
#after idle [list [namespace current]::fromServer $sock] #after idle [list [namespace current]::fromServer $sock]
fileevent $sock readable [list [namespace current]::fromServer $sock] chan event $sock readable [list [namespace current]::fromServer $sock]
} else { } else {
fileevent $sock readable [list [namespace current]::fromServer $sock] chan event $sock readable [list [namespace current]::fromServer $sock]
} }
} }
proc disconnect {sock} { proc disconnect {sock} {
variable closed variable closed
puts stdout "local disconnect" puts stdout "local disconnect"
catch {fileevent $sock readable {}} catch {chan event $sock readable {}}
catch {close $sock} catch {close $sock}
set closed($sock) 1 set closed($sock) 1
fileevent stdin readable {} chan event stdin readable {}
} }
proc write string { proc write string {

2
src/modules/punk/cap/handlers/templates-999999.0a1.0.tm

@ -95,7 +95,7 @@ namespace eval punk::cap::handlers::templates {
} else { } else {
set tm_exists [file exists $tmfile] set tm_exists [file exists $tmfile]
} }
if {![file exists $tmfile]} { if {!$tm_exists} {
puts stderr "punk::cap::handlers::templates::capsystem::pkg_register WARNING - unable to determine base folder for package '$pkg' which is attempting to register with punk::cap as a provider of '$capname' capability" puts stderr "punk::cap::handlers::templates::capsystem::pkg_register WARNING - unable to determine base folder for package '$pkg' which is attempting to register with punk::cap as a provider of '$capname' capability"
flush stderr flush stderr
return 0 return 0

2
src/modules/punk/char-999999.0a1.0.tm

@ -1181,7 +1181,7 @@ tcl::namespace::eval punk::char {
} }
puts "ok.. loading" puts "ok.. loading"
set fd [open $file r] set fd [open $file r]
fconfigure $fd -translation binary chan configure $fd -translation binary
set data [read $fd] set data [read $fd]
close $fd close $fd
set block_count 0 set block_count 0

2
src/modules/punk/config-0.1.tm

@ -32,7 +32,7 @@ tcl::namespace::eval punk::config {
if {$exename ne ""} { if {$exename ne ""} {
set exefolder [file dirname $exename] set exefolder [file dirname $exename]
#default file logs to logs folder at same level as exe if writable, or empty string #default file logs to logs folder at same level as exe if writable, or empty string
set log_folder [file normalize $exefolder/../logs] set log_folder [file normalize $exefolder/../logs] ;#~2ms
#tcl::dict::set startup scriptlib $exefolder/scriptlib #tcl::dict::set startup scriptlib $exefolder/scriptlib
#tcl::dict::set startup apps $exefolder/../../punkapps #tcl::dict::set startup apps $exefolder/../../punkapps

4
src/modules/punk/console-999999.0a1.0.tm

@ -814,7 +814,7 @@ namespace eval punk::console {
#it *might* be ok to restore entire state on an input channel #it *might* be ok to restore entire state on an input channel
#(it's not always on all channels - e.g stdout has -winsize which is read-only) #(it's not always on all channels - e.g stdout has -winsize which is read-only)
#Safest to only restore what we think we've modified. #Safest to only restore what we think we've modified.
fconfigure $input -blocking [dict get $previous_input_state -blocking] chan configure $input -blocking [dict get $previous_input_state -blocking]
@ -1947,7 +1947,7 @@ namespace eval punk::console {
set was_raw 1 set was_raw 1
} }
puts -nonewline stdout \033\[6n ;flush stdout puts -nonewline stdout \033\[6n ;flush stdout
fconfigure stdin -blocking 0 chan configure stdin -blocking 0
set info [read stdin 20] ;# set info [read stdin 20] ;#
after 1 after 1
if {[string first "R" $info] <=0} { if {[string first "R" $info] <=0} {

13
src/modules/punk/fileline-999999.0a1.0.tm

@ -158,7 +158,7 @@ namespace eval punk::fileline::class {
#[para] Constructor for textinfo object which represents a chunk or all of a file #[para] Constructor for textinfo object which represents a chunk or all of a file
#[para] datachunk should be passed with the file data including line-endings as-is for full functionality. ie use something like: #[para] datachunk should be passed with the file data including line-endings as-is for full functionality. ie use something like:
#[example_begin] #[example_begin]
# fconfigure $fd -translation binary # chan configure $fd -translation binary
# set chunkdata [lb]read $fd[rb]] # set chunkdata [lb]read $fd[rb]]
#or #or
# set chunkdata [lb]fileutil::cat <filename> -translation binary[rb] # set chunkdata [lb]fileutil::cat <filename> -translation binary[rb]
@ -1221,8 +1221,11 @@ namespace eval punk::fileline::class {
#o_linemap #o_linemap
set oldsize [string length $o_chunk] set oldsize [string length $o_chunk]
set newchunk "" set newchunk ""
#review - what was the intention here?
puts stderr "regenerate_chunk -warning code incomplete"
dict for {idx lineinfo} $o_linemap { dict for {idx lineinfo} $o_linemap {
set #???
#set
} }
@ -1287,7 +1290,7 @@ namespace eval punk::fileline {
if {$opt_file ne ""} { if {$opt_file ne ""} {
set filename $opt_file set filename $opt_file
set fd [open $filename r] set fd [open $filename r]
fconfigure $fd -translation binary -encoding $opt_translation;#should use translation binary to get actual line-endings - but we allow caller to override chan configure $fd -translation binary -encoding $opt_translation;#should use translation binary to get actual line-endings - but we allow caller to override
#Always read encoding in binary - check for bom below and/or apply chosen opt_encoding #Always read encoding in binary - check for bom below and/or apply chosen opt_encoding
set rawchunk [read $fd] set rawchunk [read $fd]
close $fd close $fd
@ -1360,7 +1363,7 @@ namespace eval punk::fileline {
set bomenc "binary" ;# utf-8??? set bomenc "binary" ;# utf-8???
set startdata 3 set startdata 3
} elseif {$maybe_bom eq "84319533"} { } elseif {$maybe_bom eq "84319533"} {
if {![dict exists [punk::char::page_names_dict gb18030]]} { if {![dict exists [punk::char::page_names_dict gb18030] gb18030]} {
puts stderr "WARNING - no direct support for GB18030 (chinese) - falling back to cp936/gbk" puts stderr "WARNING - no direct support for GB18030 (chinese) - falling back to cp936/gbk"
set bomenc cp936 set bomenc cp936
} else { } else {
@ -1485,7 +1488,7 @@ namespace eval punk::fileline {
proc file_boundary_display {filename startbyte endbyte chunksize args} { proc file_boundary_display {filename startbyte endbyte chunksize args} {
set fd [open $filename r] ;#use default error if file not readable set fd [open $filename r] ;#use default error if file not readable
fconfigure $fd -translation binary chan configure $fd -translation binary
set rawfiledata [read $fd] set rawfiledata [read $fd]
close $fd close $fd
set textobj [class::textinfo new $rawfiledata] set textobj [class::textinfo new $rawfiledata]

30
src/modules/punk/icomm-999999.0a1.0.tm

@ -875,9 +875,9 @@ namespace eval ::punk::icomm {
![string equal $encoding $comm($chan,encoding)]} { ![string equal $encoding $comm($chan,encoding)]} {
# This should not be entered yet # This should not be entered yet
set comm($chan,encoding) $encoding set comm($chan,encoding) $encoding
fconfigure $comm($chan,socket) -encoding $encoding chan configure $comm($chan,socket) -encoding $encoding
foreach {i sock} [array get comm $chan,peers,*] { foreach {i sock} [array get comm $chan,peers,*] {
fconfigure $sock -encoding $encoding chan configure $sock -encoding $encoding
} }
} }
@ -935,10 +935,10 @@ namespace eval ::punk::icomm {
set nport [incr comm(lastport)] set nport [incr comm(lastport)]
} }
set comm($chan,socket) $ret set comm($chan,socket) $ret
fconfigure $ret -translation lf -encoding $comm($chan,encoding) chan configure $ret -translation lf -encoding $comm($chan,encoding)
# If port was 0, system allocated it for us # If port was 0, system allocated it for us
set comm($chan,port) [lindex [fconfigure $ret -sockname] 2] set comm($chan,port) [lindex [chan configure $ret -sockname] 2]
return "" return ""
} }
@ -1089,8 +1089,8 @@ namespace eval ::punk::icomm {
# coroutines to hide the CSP and properly handle everything # coroutines to hide the CSP and properly handle everything
# event based. # event based.
fconfigure $fid -blocking 0 chan configure $fid -blocking 0
fileevent $fid readable [list ::punk::icomm::commIncomingOffered $chan $fid $addr $remport] chan event $fid readable [list ::punk::icomm::commIncomingOffered $chan $fid $addr $remport]
return return
} }
@ -1111,8 +1111,8 @@ namespace eval ::punk::icomm {
# Protocol version line has been received, disable event handling # Protocol version line has been received, disable event handling
# again. # again.
fileevent $fid readable {} chan event $fid readable {}
fconfigure $fid -blocking 1 chan configure $fid -blocking 1
# a list of offered proto versions is the first word of first line # a list of offered proto versions is the first word of first line
# remote id is the second word of first line # remote id is the second word of first line
@ -1143,7 +1143,7 @@ namespace eval ::punk::icomm {
if {[dict exists $chanconf -sockname]} { if {[dict exists $chanconf -sockname]} {
# If the remote host addr isn't our local host addr, # If the remote host addr isn't our local host addr,
# then add it to the remote id. # then add it to the remote id.
if {[string equal [lindex [fconfigure $fid -sockname] 0] $addr]} { if {[string equal [lindex [chan configure $fid -sockname] 0] $addr]} {
set id $remid set id $remid
} else { } else {
set id [list $remid $addr] set id [list $remid $addr]
@ -1215,8 +1215,8 @@ namespace eval ::punk::icomm {
set comm($chan,peers,$id) $fid set comm($chan,peers,$id) $fid
} }
set comm($chan,fids,$fid) $id set comm($chan,fids,$fid) $id
fconfigure $fid -translation lf -encoding $comm($chan,encoding) -blocking 0 chan configure $fid -translation lf -encoding $comm($chan,encoding) -blocking 0
fileevent $fid readable [list ::punk::icomm::commCollect $chan $fid] chan event $fid readable [list ::punk::icomm::commCollect $chan $fid]
} }
# ::punk::icomm::commLostConn -- # ::punk::icomm::commLostConn --
@ -1324,7 +1324,7 @@ namespace eval ::punk::icomm {
# ::punk::icomm::commCollect -- # ::punk::icomm::commCollect --
# #
# Internal command. Called from the fileevent to read from fid # Internal command. Called from the chan event to read from fid
# and append to the buffer. This continues until we get a whole # and append to the buffer. This continues until we get a whole
# command, which we then invoke. # command, which we then invoke.
# #
@ -1343,9 +1343,9 @@ namespace eval ::punk::icomm {
if {[catch {read $fid} nbuf] || [eof $fid]} { if {[catch {read $fid} nbuf] || [eof $fid]} {
commDebug {puts stderr "<$chan> collect/lost eof $fid = [eof $fid]"} commDebug {puts stderr "<$chan> collect/lost eof $fid = [eof $fid]"}
commDebug {puts stderr "<$chan> collect/lost nbuf = <$nbuf>"} commDebug {puts stderr "<$chan> collect/lost nbuf = <$nbuf>"}
commDebug {puts stderr "<$chan> collect/lost [fconfigure $fid]"} commDebug {puts stderr "<$chan> collect/lost [chan configure $fid]"}
fileevent $fid readable {} ;# be safe chan event $fid readable {} ;# be safe
commLostConn $chan $fid "target application died or connection lost" commLostConn $chan $fid "target application died or connection lost"
return return
} }
@ -1995,7 +1995,7 @@ proc ::punk::icomm::initlocal {{tcpport 0}} {
if {[string equal macintosh $::tcl_platform(platform)]} { if {[string equal macintosh $::tcl_platform(platform)]} {
::punk::icomm::comm new ::punk::icomm::comm -port 0 -local 0 -listen 1 ::punk::icomm::comm new ::punk::icomm::comm -port 0 -local 0 -listen 1
set ::punk::icomm::comm(localhost) \ set ::punk::icomm::comm(localhost) \
[lindex [fconfigure $::punk::icomm::comm(::punk::icomm::comm,socket) -sockname] 0] [lindex [chan configure $::punk::icomm::comm(::punk::icomm::comm,socket) -sockname] 0]
::punk::icomm::comm config -local 1 ::punk::icomm::comm config -local 1
} else { } else {
::punk::icomm::comm new ::punk::icomm::comm -port 0 -local 1 -listen 1 ::punk::icomm::comm new ::punk::icomm::comm -port 0 -local 1 -listen 1

24
src/modules/punk/lib-999999.0a1.0.tm

@ -477,7 +477,7 @@ namespace eval punk::lib {
set asegs [split [string map {:: \uFFFF} $abs] \uFFFF] set asegs [split [string map {:: \uFFFF} $abs] \uFFFF]
set acount [llength $asegs] set acount [llength $asegs]
#puts "alias $abs acount:$acount asegs:$asegs segcount:$segcount segments: $segments" #puts "alias $abs acount:$acount asegs:$asegs segcount:$segcount segments: $segments"
if {[expr {$acount - 1}] == $segcount} { if {($acount - 1) == $segcount} {
if {[lrange $asegs 0 end-1] eq $segments} { if {[lrange $asegs 0 end-1] eq $segments} {
if {[string match $glob [lindex $asegs end]]} { if {[string match $glob [lindex $asegs end]]} {
#report this alias in the current namespace - even though there may be no matching command #report this alias in the current namespace - even though there may be no matching command
@ -2760,7 +2760,7 @@ namespace eval punk::lib {
#[example_end] #[example_end]
puts stdout $question puts stdout $question
flush stdout flush stdout
set stdin_state [fconfigure stdin] set stdin_state [chan configure stdin]
if {[catch { if {[catch {
package require punk::console package require punk::console
set console_raw [tsv::get console is_raw] set console_raw [tsv::get console is_raw]
@ -2769,7 +2769,7 @@ namespace eval punk::lib {
set console_raw 0 set console_raw 0
} }
try { try {
fconfigure stdin -blocking 1 chan configure stdin -blocking 1
if {$console_raw} { if {$console_raw} {
punk::console::disableRaw punk::console::disableRaw
set answer [gets stdin] set answer [gets stdin]
@ -2778,7 +2778,7 @@ namespace eval punk::lib {
set answer [gets stdin] set answer [gets stdin]
} }
} finally { } finally {
fconfigure stdin -blocking [tcl::dict::get $stdin_state -blocking] chan configure stdin -blocking [tcl::dict::get $stdin_state -blocking]
} }
return $answer return $answer
} }
@ -3630,7 +3630,7 @@ namespace eval punk::lib {
} }
set sigma [expr {int(sqrt($s2))}] set sigma [expr {int(sqrt($s2))}]
set average [expr int($average)] set average [expr {int($average)}]
return "$average +/- $sigma microseconds per iteration" return "$average +/- $sigma microseconds per iteration"
} }
@ -3820,10 +3820,10 @@ namespace eval punk::lib {
# First, extract right hand part of number, up to and including decimal point # First, extract right hand part of number, up to and including decimal point
set point [string last "." $number]; set point [string last "." $number];
if {$point >= 0} { if {$point >= 0} {
set PostDecimal [string range $number [expr $point + 1] end]; set PostDecimal [string range $number $point+1 end];
set PostDecimalP 1; set PostDecimalP 1;
} else { } else {
set point [expr [string length $number] + 1] set point [expr {[string length $number] + 1}]
set PostDecimal ""; set PostDecimal "";
set PostDecimalP 0; set PostDecimalP 0;
} }
@ -3834,16 +3834,16 @@ namespace eval punk::lib {
incr ind; incr ind;
} }
set FirstNonSpace $ind; set FirstNonSpace $ind;
set LastSpace [expr $FirstNonSpace - 1]; set LastSpace [expr {$FirstNonSpace - 1}];
set LeadingSpaces [string range $number 0 $LastSpace]; set LeadingSpaces [string range $number 0 $LastSpace];
# Now extract the non-fractional part of the number, omitting leading spaces. # Now extract the non-fractional part of the number, omitting leading spaces.
set MainNumber [string range $number $FirstNonSpace [expr $point -1]]; set MainNumber [string range $number $FirstNonSpace $point-1];
# Insert commas into the non-fractional part. # Insert commas into the non-fractional part.
set Length [string length $MainNumber]; set Length [string length $MainNumber];
set Phase [expr $Length % $GroupSize] set Phase [expr {$Length % $GroupSize}]
set PhaseMinusOne [expr $Phase -1]; set PhaseMinusOne [expr {$Phase -1}];
set DelimitedMain ""; set DelimitedMain "";
#First we deal with the extra stuff. #First we deal with the extra stuff.
@ -3851,7 +3851,7 @@ namespace eval punk::lib {
append DelimitedMain [string range $MainNumber 0 $PhaseMinusOne]; append DelimitedMain [string range $MainNumber 0 $PhaseMinusOne];
} }
set FirstInGroup $Phase; set FirstInGroup $Phase;
set LastInGroup [expr $FirstInGroup + $GroupSize -1]; set LastInGroup [expr {$FirstInGroup + $GroupSize -1}];
while {$LastInGroup < $Length} { while {$LastInGroup < $Length} {
if {$FirstInGroup > 0} { if {$FirstInGroup > 0} {
append DelimitedMain $delim; append DelimitedMain $delim;

24
src/modules/punk/repl-999999.0a1.0.tm

@ -127,7 +127,7 @@ namespace eval punk::repl {
puts stderr "\n*> repl background error: '$message'" puts stderr "\n*> repl background error: '$message'"
#puts stderr "*> [set ::errorInfo]" #puts stderr "*> [set ::errorInfo]"
puts stderr "*> errorinfo: [dict get $errdict -errorinfo]" puts stderr "*> errorinfo: [dict get $errdict -errorinfo]"
set stdinreader [fileevent stdin readable] set stdinreader [chan event stdin readable]
if {![string length $stdinreader]} { if {![string length $stdinreader]} {
puts stderr "*> stdin reader inactive" puts stderr "*> stdin reader inactive"
} else { } else {
@ -420,14 +420,14 @@ proc repl::start {inchan args} {
puts stderr "-->repl::start active on $inchan $args replthread:[thread::id] codethread:$codethread" puts stderr "-->repl::start active on $inchan $args replthread:[thread::id] codethread:$codethread"
set prompt_config [punk::repl::get_prompt_config] set prompt_config [punk::repl::get_prompt_config]
doprompt "P% " doprompt "P% "
fileevent $inchan readable [list [namespace current]::repl_handler $inchan $prompt_config] chan event $inchan readable [list [namespace current]::repl_handler $inchan $prompt_config]
set reading 1 set reading 1
#catch { #catch {
# set punk::console::tabwidth [punk::console::get_tabstop_apparent_width] # set punk::console::tabwidth [punk::console::get_tabstop_apparent_width]
#} #}
vwait [namespace current]::done vwait [namespace current]::done
fileevent $inchan readable {} chan event $inchan readable {}
#puts stderr "-->start done = $::repl::done" #puts stderr "-->start done = $::repl::done"
@ -1327,7 +1327,7 @@ proc repl::repl_handler {inputchan prompt_config} {
set prompt_reset_flag 0 set prompt_reset_flag 0
} }
fileevent $inputchan readable {} chan event $inputchan readable {}
upvar ::punk::console::input_chunks_waiting input_chunks_waiting upvar ::punk::console::input_chunks_waiting input_chunks_waiting
#note -inputmode not available in Tcl 8.6 for chan configure! #note -inputmode not available in Tcl 8.6 for chan configure!
#According to DKF - -buffering option doesn't affect input channels #According to DKF - -buffering option doesn't affect input channels
@ -1542,14 +1542,14 @@ proc repl::repl_handler {inputchan prompt_config} {
#Re-enable channel read handler only if no waiting chunks - must process in order #Re-enable channel read handler only if no waiting chunks - must process in order
################################################################################## ##################################################################################
if {![llength $input_chunks_waiting($inputchan)]} { if {![llength $input_chunks_waiting($inputchan)]} {
fileevent $inputchan readable [list ::repl::repl_handler $inputchan $prompt_config] chan event $inputchan readable [list ::repl::repl_handler $inputchan $prompt_config]
} else { } else {
after idle [list ::repl::repl_handler $inputchan $prompt_config] after idle [list ::repl::repl_handler $inputchan $prompt_config]
} }
#################################################### ####################################################
} else { } else {
#repl_handler_checkchannel $inputchan #repl_handler_checkchannel $inputchan
fileevent $inputchan readable {} chan event $inputchan readable {}
set reading 0 set reading 0
thread::send -async $::repl::codethread {set ::punk::repl::codethread::running 0} thread::send -async $::repl::codethread {set ::punk::repl::codethread::running 0}
if {$::tcl_interactive} { if {$::tcl_interactive} {
@ -1757,7 +1757,7 @@ proc repl::repl_process_data {inputchan chunktype chunk stdinlines prompt_config
# #review # #review
# rputs stderr "->0byte read stdin" # rputs stderr "->0byte read stdin"
# if {[chan eof $inputchan]} { # if {[chan eof $inputchan]} {
# fileevent $inputchan readable {} # chan event $inputchan readable {}
# set reading 0 # set reading 0
# #set running 0 # #set running 0
# if {$::tcl_interactive} { # if {$::tcl_interactive} {
@ -1973,7 +1973,7 @@ proc repl::repl_process_data {inputchan chunktype chunk stdinlines prompt_config
rputs stderr "-------------" rputs stderr "-------------"
rputs stderr "$::errorInfo" rputs stderr "$::errorInfo"
rputs stderr "-------------" rputs stderr "-------------"
set stdinreader [fileevent $inputchan readable] set stdinreader [chan event $inputchan readable]
if {![string length $stdinreader]} { if {![string length $stdinreader]} {
rputs stderr "*> $inputchan reader inactive" rputs stderr "*> $inputchan reader inactive"
} else { } else {
@ -2185,7 +2185,7 @@ proc repl::repl_process_data {inputchan chunktype chunk stdinlines prompt_config
#chan configure stdout -buffering none #chan configure stdout -buffering none
#JMN #JMN
fileevent $inputchan readable {} chan event $inputchan readable {}
set reading 0 set reading 0
#don't let unknown use 'args' to convert commandstr to list #don't let unknown use 'args' to convert commandstr to list
#=============================================================================== #===============================================================================
@ -2529,7 +2529,7 @@ proc repl::repl_process_data {inputchan chunktype chunk stdinlines prompt_config
#append commandstr \n #append commandstr \n
if {$::punk::repl::signal_control_c} { if {$::punk::repl::signal_control_c} {
set ::punk::repl::signal_control_c 0 set ::punk::repl::signal_control_c 0
fileevent $inputchan readable {} chan event $inputchan readable {}
rputs stderr "* console_control: control-c" rputs stderr "* console_control: control-c"
flush stderr flush stderr
set c [a yellow bold] set c [a yellow bold]
@ -2578,7 +2578,7 @@ proc repl::repl_process_data {inputchan chunktype chunk stdinlines prompt_config
} }
#fileevent $inputchan readable [list repl::repl_handler $inputchan $prompt_config] #chan event $inputchan readable [list repl::repl_handler $inputchan $prompt_config]
#catch {puts stderr "zend--->[rep $::arglej]"} #catch {puts stderr "zend--->[rep $::arglej]"}
@ -2590,7 +2590,7 @@ proc repl::repl_process_data {inputchan chunktype chunk stdinlines prompt_config
rputs stderr "-------------" rputs stderr "-------------"
rputs stderr "$::errorInfo" rputs stderr "$::errorInfo"
rputs stderr "-------------" rputs stderr "-------------"
set stdinreader [fileevent $inputchan readable] set stdinreader [chan event $inputchan readable]
if {![string length $stdinreader]} { if {![string length $stdinreader]} {
rputs stderr "*> $inputchan reader inactive" rputs stderr "*> $inputchan reader inactive"
} else { } else {

4
src/modules/punk/sshrun-999999.0a1.0.tm

@ -306,7 +306,7 @@ namespace eval punk::sshrun {
# }] # }]
variable ssh; variable ssh;
system::_verify_connection $host; system::_verify_connection $host;
fileevent $ssh($host,F) $readable_writable $script; chan event $ssh($host,F) $readable_writable $script;
} }
proc hfconfigure {host args} { proc hfconfigure {host args} {
@ -314,7 +314,7 @@ namespace eval punk::sshrun {
# [call hconfigure [arg host] [arg args]] # [call hconfigure [arg host] [arg args]]
variable ssh; variable ssh;
system::_verify_connection $host; system::_verify_connection $host;
eval fconfigure $ssh($host,F) $args; eval chan configure $ssh($host,F) $args;
} }
proc rexec {host script output_varname} { proc rexec {host script output_varname} {

14
src/modules/punk/winrun-999999.0a1.0.tm

@ -37,7 +37,7 @@ namespace eval punk::winrun {
} }
proc readchild_handler {chan hpid} { proc readchild_handler {chan hpid} {
#fileevent $chan readable {} #chan event $chan readable {}
set data [read $chan 4096] set data [read $chan 4096]
while {![chan blocked $chan] && ![eof $chan]} { while {![chan blocked $chan] && ![eof $chan]} {
append data [read $chan 4096] append data [read $chan 4096]
@ -46,19 +46,19 @@ namespace eval punk::winrun {
flush stdout flush stdout
if {![eof $chan]} { if {![eof $chan]} {
puts stdout "not eof $chan [fconfigure $chan] chan blocked:[chan blocked $chan]" puts stdout "not eof $chan [fconfigure $chan] chan blocked:[chan blocked $chan]"
#fileevent $chan readable [list punk::winrun::readchild_handler $chan $hpid] #chan event $chan readable [list punk::winrun::readchild_handler $chan $hpid]
} else { } else {
#puts "eof: waiting exit process" #puts "eof: waiting exit process"
set punk::winrun::waitresult [twapi::wait_on_handle $hpid -wait -1] set punk::winrun::waitresult [twapi::wait_on_handle $hpid -wait -1]
} }
} }
proc readchilderr_handler {chan} { proc readchilderr_handler {chan} {
fileevent $chan readable {} chan event $chan readable {}
set data [read $chan] set data [read $chan]
puts stderr "err: $data" puts stderr "err: $data"
flush stderr flush stderr
if {![eof $chan]} { if {![eof $chan]} {
fileevent $chan readable [list punk::winrun::readchild_handler $chan] chan event $chan readable [list punk::winrun::readchild_handler $chan]
} }
} }
@ -81,7 +81,7 @@ namespace eval punk::winrun {
#after 1000 #after 1000
chan configure $readout -blocking 0 chan configure $readout -blocking 0
fileevent $readout readable [list readchild_handler $readout $hpid] chan event $readout readable [list readchild_handler $readout $hpid]
puts stdout "input: [chan configure $writein]" puts stdout "input: [chan configure $writein]"
puts $writein "puts stdout blah;" puts $writein "puts stdout blah;"
flush $writein flush $writein
@ -106,8 +106,8 @@ namespace eval punk::winrun {
if {$waitresult eq "timeout"} { if {$waitresult eq "timeout"} {
puts stderr "tw_run: timeout waiting for process" puts stderr "tw_run: timeout waiting for process"
} }
fileevent $readout readable {} chan event $readout readable {}
fileevent $readerr readable {} chan event $readerr readable {}
set code [twapi::get_process_exit_code $hpid] set code [twapi::get_process_exit_code $hpid]
twapi::close_handle $htid twapi::close_handle $htid

2
src/modules/punkcheck-0.1.0.tm

@ -86,7 +86,7 @@ namespace eval punkcheck {
set linecount [llength [split $newtdl \n]] set linecount [llength [split $newtdl \n]]
#puts stdout $newtdl #puts stdout $newtdl
set fd [open $punkcheck_file w] set fd [open $punkcheck_file w]
fconfigure $fd -translation binary chan configure $fd -translation binary
puts -nonewline $fd $newtdl puts -nonewline $fd $newtdl
close $fd close $fd
return [list recordcount [llength $recordlist] linecount $linecount] return [list recordcount [llength $recordlist] linecount $linecount]

11
src/modules/shellrun-0.1.1.tm

@ -283,7 +283,8 @@ namespace eval shellrun {
#exitcode not part of return value for runout - colourcode appropriately #exitcode not part of return value for runout - colourcode appropriately
set n $RST set n $RST
set c "" set c ""
if [dict exists $exitinfo exitcode] {
if {[dict exists $exitinfo exitcode]} {
set code [dict get $exitinfo exitcode] set code [dict get $exitinfo exitcode]
if {$code == 0} { if {$code == 0} {
set c [a+ green] set c [a+ green]
@ -291,7 +292,7 @@ namespace eval shellrun {
set c [a+ white bold] set c [a+ white bold]
} }
lappend chunklist [list "info" "$c$exitinfo$n"] lappend chunklist [list "info" "$c$exitinfo$n"]
} elseif [dict exists $exitinfo error] { } elseif {[dict exists $exitinfo error]} {
set c [a+ yellow bold] set c [a+ yellow bold]
lappend chunklist [list "info" "${c}error [dict get $exitinfo error]$n"] lappend chunklist [list "info" "${c}error [dict get $exitinfo error]$n"]
lappend chunklist [list "info" "errorCode [dict get $exitinfo errorCode]"] lappend chunklist [list "info" "errorCode [dict get $exitinfo errorCode]"]
@ -398,17 +399,15 @@ namespace eval shellrun {
set n [a] set n [a]
set c "" set c ""
if [dict exists $exitinfo exitcode] { if {[dict exists $exitinfo exitcode]} {
set code [dict get $exitinfo exitcode] set code [dict get $exitinfo exitcode]
if {$code == 0} { if {$code == 0} {
set c [a+ green] set c [a+ green]
} else { } else {
set c [a+ white bold] set c [a+ white bold]
} }
lappend chunklist [list "info" "$c$exitinfo$n"] lappend chunklist [list "info" "$c$exitinfo$n"]
} elseif {[dict exists $exitinfo error]} {
} elseif [dict exists $exitinfo error] {
set c [a+ yellow bold] set c [a+ yellow bold]
lappend chunklist [list "info" "error [dict get $exitinfo error]"] lappend chunklist [list "info" "error [dict get $exitinfo error]"]
lappend chunklist [list "info" "errorCode [dict get $exitinfo errorCode]"] lappend chunklist [list "info" "errorCode [dict get $exitinfo errorCode]"]

12
src/modules/shellthread-1.6.1.tm

@ -209,10 +209,10 @@ namespace eval shellthread::worker {
variable sysloghost_port variable sysloghost_port
variable sock variable sock
if {[string length $sysloghost_port]} { if {[string length $sysloghost_port]} {
if {[catch {fconfigure $sock} state]} { if {[catch {chan configure $sock} state]} {
set sock [udp_open] set sock [udp_open]
fconfigure $sock -buffering none -translation binary chan configure $sock -buffering none -translation binary
fconfigure $sock -remote $sysloghost_port chan configure $sock -remote $sysloghost_port
} }
} }
} }
@ -220,7 +220,7 @@ namespace eval shellthread::worker {
variable sock variable sock
catch {close $sock} catch {close $sock}
_initsock _initsock
return [fconfigure $sock] return [chan configure $sock]
} }
proc send_info {client_tid ts_sent source msg} { proc send_info {client_tid ts_sent source msg} {
@ -436,7 +436,7 @@ namespace eval shellthread::manager {
# todo - some protection mechanism for case where target is a file to stop creation of multiple worker threads writing to same file. # todo - some protection mechanism for case where target is a file to stop creation of multiple worker threads writing to same file.
# Even if we use open fd,close fd wrapped around writes.. it is probably undesirable to have multiple threads with same target # Even if we use open fd,close fd wrapped around writes.. it is probably undesirable to have multiple threads with same target
# On the other hand socket targets such as UDP can happily be written to by multiple threads. # On the other hand socket targets such as UDP can happily be written to by multiple threads.
# For now the mechanism is that a call to new_worker (rename to open_worker?) will join the same thread if a sourcetag matches.. # For now the mechanism is that a call to new_worker (rename to open_worker?) will join the same thread if a sourcetag matches.
# but, as sourcetags can get removed(unsubbed via leave_worker) this doesn't guarantee two threads with same -file settings won't fight. # but, as sourcetags can get removed(unsubbed via leave_worker) this doesn't guarantee two threads with same -file settings won't fight.
# Also.. the settingsdict is ignored when joining with a tag that exists.. this is problematic.. e.g logrotation where previous file still being written by existing worker # Also.. the settingsdict is ignored when joining with a tag that exists.. this is problematic.. e.g logrotation where previous file still being written by existing worker
# todo - rename 'sourcetag' concept to 'targettag' ?? the concept is a mixture of both.. it is somewhat analagous to a syslog 'facility' # todo - rename 'sourcetag' concept to 'targettag' ?? the concept is a mixture of both.. it is somewhat analagous to a syslog 'facility'
@ -751,7 +751,7 @@ namespace eval shellthread::manager {
set ts_end_list [dict get $workers $source ts_end_list] ;#ts_end_list is just a list of timestamps of closing calls for this source - only one is needed to close, but they may all come in a flurry. set ts_end_list [dict get $workers $source ts_end_list] ;#ts_end_list is just a list of timestamps of closing calls for this source - only one is needed to close, but they may all come in a flurry.
if {[llength $ts_end_list]} { if {[llength $ts_end_list]} {
set last_end_ts [lindex $ts_end_list end] set last_end_ts [lindex $ts_end_list end]
if {[expr {(($tsnow - $last_end_ts) / 1000) >= $timeout}]} { if {(($tsnow - $last_end_ts) / 1000) >= $timeout} {
lappend ts_end_list $ts_now lappend ts_end_list $ts_now
dict set workers $source ts_end_list $ts_end_list dict set workers $source ts_end_list $ts_end_list
} else { } else {

6
src/modules/textblock-999999.0a1.0.tm

@ -663,7 +663,7 @@ tcl::namespace::eval textblock {
switch -- $k { switch -- $k {
-ansibase_header - -ansibase_body - -ansiborder_header - -ansiborder-body - -ansiborder_footer { -ansibase_header - -ansibase_body - -ansiborder_header - -ansiborder-body - -ansiborder_footer {
set parts [punk::ansi::ta::split_codes_single $v] ;#caller may have supplied separated codes eg "[a+ Yellow][a+ red]" set parts [punk::ansi::ta::split_codes_single $v] ;#caller may have supplied separated codes eg "[a+ Yellow][a+ red]"
set ansi_codes [list] ; set ansi_codes [list]
foreach {pt code} $parts { foreach {pt code} $parts {
if {$pt ne ""} { if {$pt ne ""} {
#we don't expect plaintext in an ansibase #we don't expect plaintext in an ansibase
@ -1109,7 +1109,7 @@ tcl::namespace::eval textblock {
} }
-ansibase { -ansibase {
set parts [punk::ansi::ta::split_codes_single $v] ;#caller may have supplied separated codes eg "[a+ Yellow][a+ red]" set parts [punk::ansi::ta::split_codes_single $v] ;#caller may have supplied separated codes eg "[a+ Yellow][a+ red]"
set col_ansibase_items [list] ; set col_ansibase_items [list]
foreach {pt code} $parts { foreach {pt code} $parts {
if {$pt ne ""} { if {$pt ne ""} {
#we don't expect plaintext in an ansibase #we don't expect plaintext in an ansibase
@ -7852,7 +7852,7 @@ tcl::namespace::eval textblock {
foreach {k v} $optlist { foreach {k v} $optlist {
set k2 [tcl::prefix::match -error "" $optnames $k] set k2 [tcl::prefix::match -error "" $optnames $k]
switch -- $k2 { switch -- $k2 {
-etabs - -type - -boxlimits - -boxmap - -joins -etabs - -type - -boxlimits - -boxmap - -join
- -title - -titlealign - -subtitle - -subtitlealign - -width - -height - -title - -titlealign - -subtitle - -subtitlealign - -width - -height
- -ansiborder - -ansibase - -ansiborder - -ansibase
- -blockalign - -textalign - -ellipsis - -blockalign - -textalign - -ellipsis

Loading…
Cancel
Save