X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2FmatitaScript.ml;h=6a03e3538652c379234d31e76197627ab8d51a1a;hb=68a413ec8a20ef0d73fcd5810be7db659abe6f92;hp=74a95bb107d00fa6972c04187932fff3b7c0c49b;hpb=7a370b14d9f897943efe564fd1b36daa3421735b;p=helm.git diff --git a/matita/matita/matitaScript.ml b/matita/matita/matitaScript.ml index 74a95bb10..6a03e3538 100644 --- a/matita/matita/matitaScript.ml +++ b/matita/matita/matitaScript.ml @@ -117,11 +117,16 @@ 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 None ctx menv subst (parsed_text,parsed_text_length, + status `XTNone ctx menv subst (parsed_text,parsed_text_length, NotationPt.Cast (t,NotationPt.Implicit `JustOne)) (* XXX use the metasenv, if possible *) in