trill_on_swish/commit

Upstream fixes

authorJan Wielemaker
Fri Dec 12 16:57:58 2014 +0100
committerJan Wielemaker
Fri Dec 12 16:57:58 2014 +0100
commit9ae1f3b103d2eeb17b9a79ba8a33e0b0bb1dbe8f
tree3458a9bf0ba8c0af17126af2c7b6958120c6b2ef
parenta072bdd25d1755919a84fa973af2a2352823fe2f
Diff style: patch stat
diff --git a/lib/swish/config.pl b/lib/swish/config.pl
index 6fa08fc..28e7756 100644
--- a/lib/swish/config.pl
+++ b/lib/swish/config.pl
@@ -67,8 +67,12 @@ http_locations(JSON) :-
 
 remove_duplicate_ids([], []).
 remove_duplicate_ids([Id-Path1,Id-Path2|T], [Id-Path1|Cleaned]) :- !,
-	same_ids(T, Id, T1, Paths),
-	print_message(warning, http(duplicate_handlers(Id, [Path1,Path2|Paths]))),
+	same_ids(T, Id, T1, Paths0),
+	sort([Path1,Path2|Paths0], Unique),
+	(   Unique = [_]
+	->  true
+	;   print_message(warning, http(duplicate_handlers(Id, Unique)))
+	),
 	remove_duplicate_ids(T1, Cleaned).
 remove_duplicate_ids([H|T0], [H|T]) :-
 	remove_duplicate_ids(T0, T).
diff --git a/lib/swish/highlight.pl b/lib/swish/highlight.pl
index cef6979..7c66b0c 100644
--- a/lib/swish/highlight.pl
+++ b/lib/swish/highlight.pl
@@ -682,7 +682,7 @@ goal_arity(Goal, Arity) :-
 	swish_config:config/2,
 	css/3.				% ?Context, ?Selector, -Attributes
 
-%%	swish_config:config(-Name, -Styles) is det.
+%%	swish_config:config(-Name, -Styles) is nondet.
 %
 %	Provides the object `config.swish.style`,  a   JSON  object that
 %	maps   style   properties   of    user-defined   extensions   of
@@ -859,7 +859,7 @@ predicate_info(PI, Info) :-
 
 					% ISO predicates
 predicate_info(Module:Name/Arity, Key, Value) :-
-	compound_name_arity(Head, Name, Arity),
+	functor(Head, Name, Arity),
 	predicate_property(system:Head, iso), !,
 	ignore(Module = system),
 	(   catch(predicate(Name, Arity, Summary, _, _), _, fail),
diff --git a/lib/swish/render.pl b/lib/swish/render.pl
index a55fea8..ee80729 100644
--- a/lib/swish/render.pl
+++ b/lib/swish/render.pl
@@ -31,7 +31,8 @@
 	  [ use_rendering/1,		% +Renderer
 	    use_rendering/2,		% +Renderer, +Options
 
-	    register_renderer/2		% Declare a rendering module
+	    register_renderer/2,	% Declare a rendering module
+	    current_renderer/2		% Name, Comment
 	  ]).
 :- use_module(library(pengines_io), []).
 :- use_module(library(http/html_write)).
@@ -192,6 +193,13 @@ tokens([H|T]) --> [H], tokens(T).
 :- multifile
 	renderer/3.
 
+%%	current_renderer(Name, Comment) is nondet.
+%
+%	True when renderer Name is declared with Comment.
+
+current_renderer(Name, Comment) :-
+	renderer(Name, _Module, Comment).
+
 %%	register_renderer(:Name, +Comment)
 %
 %	Register a module as SWISH rendering component.
diff --git a/web/help/background.html b/web/help/background.html
index 51d5521..ec754ac 100644
--- a/web/help/background.html
+++ b/web/help/background.html
@@ -54,7 +54,7 @@ is implemented as a set of <a target="_blank" href="http://jquery.com/">jQuery</
 using <a target="_blank" href="http://getbootstrap.com/">Bootstrap</a> for menus, modal windows
 and various styling aspects and <a target="_blank" href="http://codemirror.net/">CodeMirror</a>
 for editing the Prolog source and query.  Queries are executed by sending both the source text
-(right editor) and query (bottom-left editor) to the server, which creates a <a target="_blank"
+(left editor) and query (bottom-right editor) to the server, which creates a <a target="_blank"
 href="http://www.swi-prolog.org/pldoc/man?section=pengines">Pengine</a> (<i>Prolog Engine</i>)
 to execute the query.
 		</p>
diff --git a/web/help/help.html b/web/help/help.html
index 2784463..1bf6a6c 100644
--- a/web/help/help.html
+++ b/web/help/help.html
@@ -16,7 +16,7 @@
 <h4 id="help-basics">Basic operation</h4>
 <p>
 Prolog is about running a <i>query</i> against a <i>program</i>. The
-<i>query</i> goes into the bottom-left editor and the <i>program</i>
+<i>query</i> goes into the bottom-right editor and the <i>program</i>
 into the left editor.  The program can be empty, executing queries
 against the <i>built-in</i> predicates of Prolog.  For example:
 
@@ -37,7 +37,7 @@ or by using the <b>Run!</b> button.  At this moment, the following happens:
       (<i>Prolog Engine</i>).
   <li>The Pengine compiles the program into a temporary private module.
   <li>The Pengine assesses whether executing the query can compromise
-      the query.  If this fails, an error is displated.  See
+      the server.  If this fails, an error is displated.  See
       the help topic <b>Caveats ...</b> for details.
   <li>If the query is considered safe, it executes the query and
       communicates with the <em>runner</em>