--- ray/src/util/util.tcl 1994/10/27 15:56:12 2.1 +++ ray/src/util/util.tcl 1994/12/09 14:17:47 2.3 @@ -10,7 +10,12 @@ proc beep {} { # ring the bell proc view_txt fn { # view a text file global env if [info exists env(EDITOR)] { - eval exec xterm -e $env(EDITOR) $fn + if {[lsearch -exact {vi vedit view ex edit ed red} \ + [file tail [lindex $env(EDITOR) 0]]] >= 0} { + eval exec xterm +sb -e $env(EDITOR) $fn + } else { + eval exec $env(EDITOR) $fn + } } else { foreach f $fn { exec xedit $f @@ -28,4 +33,17 @@ proc cardval {var cvl} { # set variable to one of a se } } return {} ; # this would seem to be an error +} + +proc writevars {f vl} { # write variables to a file + foreach v $vl { + upvar $v myv + if [catch {set il [array names myv]}] { + puts $f "set $v [list $myv]" + } else { + foreach i $il { + puts $f "set ${v}($i) [list $myv($i)]" + } + } + } }