proc CallStack { string } {
    puts $string
    for {set x [expr [info level]-1]} {$x > 0} {incr x -1} {
	set i [info level $x]
	set p [lindex $i 0]
	set a [string range [lindex $i 1] 0 5]
	puts "$x: $p $a ..."
    }
}

proc TraceListtags {{win .text}} {
    global HM$win
    trace variable HM$win\(listtags) wu [list TraceListtagsProc $win]
}

proc TraceListtagsProc {win name1 name2 op} {
    if {$op == "u"} {
	puts [CallStack "$name1\($name2) UNSET"]
	global HM$win
	trace variable HM$win\($name2) wu [list TraceListtagsProc $win]
    } else {
	upvar #0 HM$win var
	puts [CallStack "$name2 $var($name2)"]
    }
}
