
proc msg {txt} {
    set a [::msgcat::mc $txt]
    update idletasks
}

proc foo {} {
    msg "hi"
    set a 1
}

proc log {args} {
    puts [string range $args 0 40]
}

trace add execution foo {enter leave enterstep leavestep} log

puts stderr "tracing without any idletasks"
puts stderr "notice how there is a line '{msg hi} 0 {} leavestep'"
update
foo

puts stderr "tracing with idletask"
after idle {puts idle} ; foo

puts stderr "Notice how in the second run, the following lines"
puts stderr "are missing {
    {msg hi} 0 {} leavestep
    {set a 1} enterstep
    {set a 1} 0 1 leavestep
}"

catch {console show}

