set realcols $cols
set cols [expr {$cols - $chop_l - $chop_r}]
- puts stderr "NOW cols=$cols chop_l,r=$chop_l,$chop_r rows=$rows\
+ debug "NOW cols=$cols chop_l,r=$chop_l,$chop_r rows=$rows\
$unk_l $unk_r $ngd"
set mulcols [expr {$cols*$mul+$inter}]
}
bind_key Return {
if {$cur_0 != $cur_1} {
+ .d.csr.csr.e delete 0 end
set cur_mode text
recursor
}
bind_key Return {
set strq [.d.csr.csr.e get]
if {[regexp {^(?:[!-[]|[]-~]|\\\\|\\x[0-9a-f]{2})+} $strq]} {
- .d.csr.csr.e delete 0 end
RETURN_RESULT DEFINE "$cur_0 $cur_1 $strq"
}
}
global database database_header rows database_fn
catch { unset database }
set database_fn ./charset-$rows.txt
+ if {![file exists $database_fn]} return
set f [open $database_fn r]
if {[string compare [db_getsl $f] $database_header]} { error "$l ?" }
if {([db_getsl $f])+0 != $rows} { error "wrong h ?" }
helptext {{{ Processing }}}
unbind_all_keys
update idletasks
- puts stderr "$how $what"
+ debug "$how $what"
eval update_database/$how $what
done/$mainkind
}
init_widgets
manyset [lrange $l 0 3] unk_l unk_r unk_contexts
set glyphsdone [lrange $l 3 end]
- puts stderr "SHOW-THING GOT $l"
+ debug "GOT $l"
fileevent stdin readable {}
+ fconfigure stdin -blocking yes
read_xpm stdin
resize_widgets
}
proc done/automatic {} {
exec sh -c {printf \\0 >&4}
- fileevent stdin readable required
+ main/automatic
}
-switch -exact -- $argv {
- {} { set mainkind test }
- {--automatic 1} { set mainkind automatic }
- {--automatic*} { error "incompatible versions - install problem" }
- default { error "huh $argv ?" }
+proc debug {m} { }
+
+set mainkind test
+foreach arg $argv {
+ switch -exact -- $arg {
+ {--debug} { proc debug {m} { puts stderr "SHOW-THING $m" } }
+ {--noop-arg} { }
+ {--automatic-1} { set mainkind automatic }
+ {--automatic*} { error "incompatible versions - install problem" }
+ default { error "huh $argv ?" }
+ }
}
main/$mainkind