# HG changeset patch # User wenzelm # Date 1221568796 -7200 # Node ID f1fc11c735693f6e69364d1357959cc8a926a6c8 # Parent c447b60d67f593e745bb92527ea8e2e388b737df check setting and tool; added file; diff -r c447b60d67f5 -r f1fc11c73569 doc-src/antiquote_setup.ML --- a/doc-src/antiquote_setup.ML Tue Sep 16 12:27:05 2008 +0200 +++ b/doc-src/antiquote_setup.ML Tue Sep 16 14:39:56 2008 +0200 @@ -153,6 +153,9 @@ let val thy = ProofContext.theory_of ctxt in defined thy o intern thy end; +fun check_tool name = + File.exists (Path.append (Path.explode "~~/lib/Tools") (Path.basic name)); + val arg = enclose "{" "}" o clean_string; fun output_entity check markup index kind ctxt (logic, name) = @@ -174,7 +177,7 @@ |> (if ! O.quotes then quote else I) |> (if ! O.display then enclose "\\begin{isabelle}%\n" "%\n\\end{isabelle}" else hyper o enclose "\\mbox{\\isa{" "}}")) - else error ("Undefined " ^ kind ^ " " ^ quote name) + else error ("Bad " ^ kind ^ " " ^ quote name) end; fun entity check markup index kind = @@ -199,9 +202,10 @@ entity_antiqs no_check "" "variable" @ entity_antiqs no_check "" "case" @ entity_antiqs (K ThyOutput.defined_command) "" "antiquotation" @ - entity_antiqs no_check "isatt" "setting" @ + entity_antiqs (fn _ => fn name => is_some (OS.Process.getEnv name)) "isatt" "setting" @ entity_antiqs no_check "isatt" "executable" @ - entity_antiqs no_check "isatt" "tool"); + entity_antiqs (K check_tool) "isatt" "tool" @ + entity_antiqs (K (File.exists o Path.explode)) "isatt" "file"); end;