Evaluated proc %- {who q} {set plist [list]; set parts [ltrim $::playlist($who)]; set out ""; for {set i 0} {$i < [llength $parts]} {incr i 3} { set part [lrange $parts $i [+ $i 2]]; if {[regexp -nocase $q $part] == 0} { linsert plist $part end } else { append out "[lindex [split [%% $who] \n] [expr $i/3]]\n"} }; set ::playlist($who) [ltrim [n $plist]]; . $out}