blocklist=!filelist $wims_home/$Docdir/$doc
!writefile $docdir/$doc/.index
blocklist=!words2items $blocklist

!if $job2=erase and $block!=$empty and $block!=main
  !for b in $blocklist
    !set bsrc=!replace internal .def by  in $b
    !set prevnext=prev, next, upbl
    !for field in $prevnext
      !set bhd=!defof $field in wimshome/$Docdir/$doc/src/$bsrc.hd
      !if $bhd=$block
        !setdef !set $field=$empty in wimshome/$Docdir/$doc/src/$bsrc.hd
      !endif
    !next
  !next
!endif

!for b in $blocklist
  !if .def $ isin $b $ and $b!=.def
    t_=!defof titb in $docdir/$doc/$b
    n_=!char 1 to -5 of $b
    !appendfile $docdir/$doc/.index :$n_\
$t_
  !endif
!next b
