Skip to content

Commit

Permalink
fix the access to the GAP help system for help books based on the
Browse files Browse the repository at this point in the history
`gapmacro.tex` format
  • Loading branch information
ThomasBreuer authored and fingolfin committed Jan 21, 2020
1 parent 752478a commit a4eb0ba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
21 changes: 16 additions & 5 deletions pkg/GAPJulia/JuliaInterface/gap/helpstring.g
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,22 @@ BindGlobal( "HELP_DESC_MATCH", function(match)
# Find the end of the subsection in question.
# This is defined either by the start of the next subsection
# of the same section, or by the start of the next section or chapter.
nextn:= book.entries[ entrynr ][3] + [ ,, 1 ];
nextentry:= PositionProperty( book.entries, x -> x[3] = nextn );
if nextentry = fail then
nextn:= nextn + [ , 1, -nextn[3] ];
nextentry:= fail;
if book.handler = "GapDocGAP" then
# This happens for most packages.
nextn:= book.entries[ entrynr ][3] + [ ,, 1 ];
nextentry:= PositionProperty( book.entries, x -> x[3] = nextn );
if nextentry = fail then
nextn:= nextn + [ , 1, -nextn[3] ];
nextentry:= PositionProperty( book.entries, x -> x[3] = nextn );
fi;
elif book.handler = "default" then
# There are still several packages with this handler.
if entrynr < Length( book.entries )
and book.entries[ entrynr ][3] = "F"
and book.entries[ entrynr+1 ][3] = "F" then
nextentry:= entrynr+1;
fi;
fi;
if IsBound( data.start ) then
firstline:= data.start;
Expand Down Expand Up @@ -466,7 +477,7 @@ InstallGlobalFunction( HELP_String, function( str, onlyexact )
str := HELP_TOPIC_RING[HELP_RING_IDX+1];
move := true;
fi;

# number means topic from HELP_LAST.TOPICS list
if book = "" and ForAll(str, a-> a in "0123456789") then
return [ HELP_DESC_FROM_LAST_TOPICS(Int(str))[2] ];
Expand Down
1 change: 1 addition & 0 deletions test/help.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@test test_gap_help( "welcome to gap" )

@test test_gap_help( "?determinant" )
@test test_gap_help( "?PermList" )
@test test_gap_help( "?IsJuliaWrapper" )
println(GAP.GAP_help_string( "?IsJuliaWrapper" ))

Expand Down

0 comments on commit a4eb0ba

Please sign in to comment.