Commit d0b49393 authored by Fred Drake's avatar Fred Drake

Fix SF bug #479967: Appearantly I broke something that made the index

insertion work.  This fix makes things at least somewhat more explicit, and
adds a little sanity checking (and verbosity!) to
add_bbl_and_idx_dummy_commands().
parent 7bdfc39c
...@@ -497,6 +497,7 @@ sub add_bbl_and_idx_dummy_commands { ...@@ -497,6 +497,7 @@ sub add_bbl_and_idx_dummy_commands {
if (scalar(@parts) == 3) { if (scalar(@parts) == 3) {
# Be careful to re-write the string in place, since $_ is *not* # Be careful to re-write the string in place, since $_ is *not*
# returned explicity; *** nasty side-effect dependency! *** # returned explicity; *** nasty side-effect dependency! ***
print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
print "\nadd_bbl_and_idx_dummy_commands ==> adding module index"; print "\nadd_bbl_and_idx_dummy_commands ==> adding module index";
my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)" my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex[\\s\\S]*)"
. "([\\\\]begin\\s*$O\\d+$C\\s*theindex)"; . "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
...@@ -509,14 +510,21 @@ sub add_bbl_and_idx_dummy_commands { ...@@ -509,14 +510,21 @@ sub add_bbl_and_idx_dummy_commands {
$HAVE_GENERAL_INDEX = 1; $HAVE_GENERAL_INDEX = 1;
} }
elsif (scalar(@parts) == 2) { elsif (scalar(@parts) == 2) {
print "\nadd_bbl_and_idx_dummy_commands ==> adding general index";
my $rx = "([\\\\]begin\\s*$O\\d+$C\\s*theindex)";
s/$rx/\\textohtmlindex \1/o;
$HAVE_GENERAL_INDEX = 1; $HAVE_GENERAL_INDEX = 1;
} }
else { elsif (scalar(@parts) == 1) {
print "\nadd_bbl_and_idx_dummy_commands ==> no index found";
$CUSTOM_BUTTONS .= get_my_icon('blank'); $CUSTOM_BUTTONS .= get_my_icon('blank');
$global{'max_id'} = $id; # not sure why.... $global{'max_id'} = $id; # not sure why....
s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o; s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
s/[\\]printindex/\\textohtmlindex /o; s/[\\]printindex/\\textohtmlindex /o;
} }
else {
die "\n\nBad number of index environments!\n\n";
}
#---------------------------------------------------------------------- #----------------------------------------------------------------------
lib_add_bbl_and_idx_dummy_commands() lib_add_bbl_and_idx_dummy_commands()
if defined(&lib_add_bbl_and_idx_dummy_commands); if defined(&lib_add_bbl_and_idx_dummy_commands);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment