--- ray/src/util/do_file.tcl 1994/10/27 15:56:06 2.1 +++ ray/src/util/do_file.tcl 1995/02/15 14:12:05 2.6 @@ -148,7 +148,7 @@ proc load_vars {f {vl all}} { # load RIF variables } if {"$vl" == "all" && ! [chksave]} {return 0} set curmess {Please wait...} - update idletasks + update if [catch {exec rad -n -w -e $f >& /usr/tmp/ro[pid]}] { set curmess [exec cat /usr/tmp/ro[pid]] exec rm -f /usr/tmp/ro[pid] @@ -242,6 +242,11 @@ proc newsave f { # save a RIF return 0 } } + if {[file exists $f] && ! [file writable $f] && + [catch {exec chmod u+w $f} curmess]} { + beep + return 0 + } if [save_vars $f] { set rifname [pwd]/$f set readonly 0 @@ -273,6 +278,7 @@ proc newnew f { # create a new RIF proc do_file w { global rifname readonly rif_glob curfile curpat if {"$w" == "done"} { + cd [file dirname $rifname] set rif_glob $curpat return } @@ -281,8 +287,8 @@ proc do_file w { pack $w.left -side left button $w.left.load -text LOAD -width 5 \ -relief raised -command {newload $curfile} - button $w.left.save -text SAVE -width 5 \ - -relief raised -command {newsave $curfile} + button $w.left.save -text SAVE -width 5 -relief raised \ + -command "newsave \$curfile; update_dir $w.right" button $w.left.new -text NEW -width 5 \ -relief raised -command {newnew $curfile} pack $w.left.load $w.left.save $w.left.new -side top -pady 15 -padx 20