initalize locale with idents from background theory rather than empty idents: must treat idents and registrations synchronously to provide consistent setup for interpretation in locale contexts
authorhaftmann
Tue, 17 Dec 2013 20:21:22 +0100
changeset 54795 e58623a33ba5
parent 54794 e279c2ceb54c
child 54796 cdc6d8cbf770
initalize locale with idents from background theory rather than empty idents: must treat idents and registrations synchronously to provide consistent setup for interpretation in locale contexts
src/Pure/Isar/locale.ML
--- a/src/Pure/Isar/locale.ML	Tue Dec 17 15:56:57 2013 +0100
+++ b/src/Pure/Isar/locale.ML	Tue Dec 17 20:21:22 2013 +0100
@@ -455,9 +455,16 @@
   end;
 
 fun init name thy =
-  activate_all name thy Element.init (Morphism.transfer_morphism o Context.theory_of)
-    (empty_idents, Context.Proof (Proof_Context.init_global thy))
-  |-> Idents.put |> Context.proof_of;
+  let
+    val context = Context.Proof (Proof_Context.init_global thy);
+    val marked = Idents.get context;
+    val (marked', context') = activate_all name thy Element.init
+      (Morphism.transfer_morphism o Context.theory_of) (empty_idents, context)
+  in
+    context'
+    |> Idents.put (merge_idents (marked, marked'))
+    |> Context.proof_of
+  end;
 
 
 (*** Add and extend registrations ***)