pro mk_todo_list, lun, lunout, letter, last_good_sec, last_sec, qgood ; ; if (n_elements(last_good_sec) eq 0) then last_good_sec = ' ' if (n_elements(last_sec) eq 0) then last_sec = ' ' if (n_elements(qgood) eq 0) then qgood = 0 ; while not eof(lun) do begin lin = ' ' readf, lun, lin p = strpos(lin, 'section{') if (p ne -1) then begin p1 = strpos(lin, '{') p2 = strpos(lin, '}') sec = strmid(lin, p1+1, p2-p1-1) if ((strpos(lin, 'subsubsection') ne -1) and (letter eq 'R')) then begin ;3 levels down not saved in MK_TOC for Ref Guide p = -1 qgood = 0 result = '' end else begin cmd = 'grep -i "' + sec + '" mk_toc.tex' ;print, cmd spawn, cmd, result end if (result(0) ne '') then begin last_sec = strtrim(result(0),2) ;have section with the last_good_sec = last_sec qgood = 1 end else begin last_sec = sec qgood = 0 end end ; p = strpos(lin, '\input') if (p eq 0) then begin remtab, lin, lin arr = str2arr(lin, delim=' ') infil2 = arr(1) openr, lun2, infil2, /get_lun mk_todo_list, lun2, lunout, letter, last_good_sec, last_sec, qgood free_lun, lun2 end p = strpos(lin, 'TODO') if (p ne -1) then begin out0 = last_good_sec if (not qgood) then out0 = last_good_sec + ' / ' + last_sec out0 = out0 + ' ' out = string(letter, out0, lin, format='(a, "-", a60, 3x, a)') print, out printf, lunout, out end end ; free_lun, lun end ;------------------------------------------------------------------------------ ; openw, lunout, 'mk_todo_list.txt', /get_lun printf, lunout, 'MK_TODO_LIST Program Run: ', !stime printf, lunout, ' ' ; openr, lun, 'uguide.tex', /get_lun & mk_todo_list, lun, lunout, 'U' openr, lun, 'rguide.tex', /get_lun & mk_todo_list, lun, lunout, 'R' openr, lun, 'iguide.tex', /get_lun & mk_todo_list, lun, lunout, 'I' ; free_lun, lunout end