X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2FmatitaScript.ml;fp=matita%2Fmatita%2FmatitaScript.ml;h=6a03e3538652c379234d31e76197627ab8d51a1a;hb=f811e07f481b135bd7c621c2d10a268dc35d599b;hp=d86871963437efbac813b5e63b590f98573af5ff;hpb=e7c0c79b866e9058d9b0a3d9a0eb4537fb6b87b1;p=helm.git diff --git a/matita/matita/matitaScript.ml b/matita/matita/matitaScript.ml index d86871963..6a03e3538 100644 --- a/matita/matita/matitaScript.ml +++ b/matita/matita/matitaScript.ml @@ -117,8 +117,13 @@ let eval_nmacro include_paths (buffer : GText.buffer) status unparsed_text parse if tl <> [] then HLog.warn "Many goals focused. Using the context of the first one\n"; - let _, ctx, _ = NCicUtils.lookup_meta g menv in - ctx in + let ctx = try + let _, ctx, _ = NCicUtils.lookup_meta g menv in ctx + with NCicUtils.Meta_not_found _ -> + HLog.warn "Current goal is closed. Using empty context."; + [ ] + in ctx + in let m, s, status, t = GrafiteDisambiguate.disambiguate_nterm status `XTNone ctx menv subst (parsed_text,parsed_text_length,