131 |
|
set curhelp(fid) [open $fname r] |
132 |
|
if {! [file exists $ifile] || |
133 |
|
[file mtime $fname] > [file mtime $ifile]} { |
134 |
< |
set curhelp(catlist) {} |
134 |
> |
set helpindex(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 |
141 |
> |
if {[lsearch -exact $helpindex(catlist) $cat] < 0} { |
142 |
> |
lappend helpindex(catlist) $cat |
143 |
|
} |
144 |
|
} |
145 |
|
} |
146 |
|
if {! [catch {set fi [open $ifile w]}]} { |
147 |
< |
writevars $fi {curhelp(catlist) helpindex} |
147 |
> |
writevars $fi helpindex |
148 |
|
close $fi |
149 |
|
catch {exec chmod 666 $ifile} |
150 |
|
} |
152 |
|
source $ifile |
153 |
|
} |
154 |
|
.helpwin.but.catb.m delete 0 last |
155 |
< |
foreach cat $curhelp(catlist) { |
155 |
> |
foreach cat $helpindex(catlist) { |
156 |
|
.helpwin.but.catb.m add command -label $cat \ |
157 |
|
-command "helphist new $cat intro" |
158 |
|
} |
309 |
|
return 0 |
310 |
|
} |
311 |
|
set nmatches 0 |
312 |
< |
set cat [lindex $curhelp(catlist) 0] |
312 |
> |
set cat [lindex $helpindex(catlist) 0] |
313 |
|
set top [lindex $helpindex([string toupper $cat]) 0] |
314 |
|
set startpos [tell $curhelp(fid)] |
315 |
|
seek $curhelp(fid) $helpindex([string toupper $cat,$top]) |