ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/gethelp3.6.tcl
(Generate patch)

Comparing ray/src/util/gethelp3.6.tcl (file contents):
Revision 2.5 by greg, Fri Oct 28 20:14:44 1994 UTC vs.
Revision 2.6 by greg, Sun Oct 30 09:05:09 1994 UTC

# Line 122 | Line 122 | proc helpopen fname {                  # open the named help file
122          wm title .helpwin $fname
123          set curhelp(title) "[string toupper\
124                          [file rootname [file tail $fname]]]  HELP"
125 +        set ifile [file rootname $fname].ndx
126          wm iconname .helpwin [string tolower $curhelp(title)]
127          .helpwin.txt configure -state normal
128          .helpwin.txt delete 1.0 end
129          .helpwin.txt insert end "Loading $fname..."
130          update
131          set curhelp(fid) [open $fname r]
132 <        set curhelp(catlist) {}
133 <        while {[gets $curhelp(fid) li] >= 0} {
134 <                if [regexp -nocase {^\.([A-Z][A-Z0-9]*)\.([A-Z][A-Z0-9]*)$} \
135 <                                $li dummy cat top] {
136 <                        lappend helpindex([string toupper $cat]) $top
137 <                        set helpindex([string toupper $cat,$top]) \
138 <                                        [tell $curhelp(fid)]
139 <                        if {[lsearch -exact $curhelp(catlist) $cat] < 0} {
140 <                                lappend curhelp(catlist) $cat
132 >        if {! [file exists $ifile] ||
133 >                        [file mtime $fname] > [file mtime $ifile]} {
134 >                set curhelp(catlist) {}
135 >                while {[gets $curhelp(fid) li] >= 0} {
136 >                        if [regexp -nocase {^\.([A-Z][A-Z0-9]*)\.([A-Z][A-Z0-9]*)$} \
137 >                                        $li dummy cat top] {
138 >                                lappend helpindex([string toupper $cat]) $top
139 >                                set helpindex([string toupper $cat,$top]) \
140 >                                                [tell $curhelp(fid)]
141 >                                if {[lsearch -exact $curhelp(catlist) $cat] < 0} {
142 >                                        lappend curhelp(catlist) $cat
143 >                                }
144                          }
145                  }
146 +                if {! [catch {set fi [open $ifile w]}]} {
147 +                        writevars $fi {curhelp(catlist) helpindex}
148 +                        close $fi
149 +                        catch {exec chmod 666 $ifile}
150 +                }
151 +        } else {
152 +                source $ifile
153          }
154          .helpwin.but.catb.m delete 0 last
155          foreach cat $curhelp(catlist) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines