Skip to content

Commit

Permalink
ENHANCED: help/1: keep track of modules for user predicates
Browse files Browse the repository at this point in the history
Also show private predicate matches.
  • Loading branch information
JanWielemaker committed Oct 18, 2023
1 parent ea19f38 commit e00390b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions library/help.pl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
links(false),
link_source(false),
navtree(false),
server(false)
server(false),
qualified(always)
]))
])
])),
Expand All @@ -196,7 +197,12 @@
man_pages([], _) -->
[].
man_pages([H|T], Options) -->
man_page(H, Options),
( man_page(H, Options)
-> []
; html(p(class(warning),
[ 'WARNING: No help for ~p'-[H]
]))
),
man_pages(T, Options).

page_width(Width) :-
Expand Down Expand Up @@ -266,7 +272,7 @@
match_name(How, Fuzzy, Name),
man_object_property(c(Name), id(ID)).
% for currently loaded predicates
help_object(Module, _How, Name/Arity, _ID) :-
help_object(Module, _How, Module:Name/Arity, _ID) :-
atom(Module),
current_module(Module),
atom_concat('sec:', Module, SecLabel),
Expand All @@ -275,10 +281,10 @@
help_object(Name/Arity, _How, Name/Arity, _ID) :-
atom(Name),
current_predicate_help(_:Name/Arity).
help_object(Fuzzy, How, Name/Arity, _ID) :-
help_object(Fuzzy, How, Module:Name/Arity, _ID) :-
atom(Fuzzy),
match_name(How, Fuzzy, Name),
current_predicate_help(_:Name/Arity).
current_predicate_help(Module:Name/Arity).

%! current_predicate_help(?PI) is nondet.
%
Expand Down

0 comments on commit e00390b

Please sign in to comment.