# HG changeset patch # User wenzelm # Date 1631046944 -7200 # Node ID be49c660ebbfa37bef30dfb88e4c3dffec1957d4 # Parent 839a6e284545fad6a7bc7daf50999b1406e7a288 more markup, e.g. to locate defining theory node in formal document output; diff -r 839a6e284545 -r be49c660ebbf src/Pure/General/name_space.ML --- a/src/Pure/General/name_space.ML Tue Sep 07 21:47:50 2021 +0200 +++ b/src/Pure/General/name_space.ML Tue Sep 07 22:35:44 2021 +0200 @@ -113,8 +113,9 @@ pos: Position.T, serial: serial}; -fun entry_markup def kind (name, {pos, serial, ...}: entry) = - Position.make_entity_markup def serial kind (name, pos); +fun entry_markup def kind (name, {pos, theory_long_name, serial, ...}: entry) = + Position.make_entity_markup def serial kind (name, pos) + ||> not (#def def) ? cons (Markup.def_theoryN, theory_long_name); fun print_entry_ref kind (name, entry) = quote (Markup.markup (entry_markup {def = false} kind (name, entry)) name); diff -r 839a6e284545 -r be49c660ebbf src/Pure/General/position.scala --- a/src/Pure/General/position.scala Tue Sep 07 21:47:50 2021 +0200 +++ b/src/Pure/General/position.scala Tue Sep 07 22:35:44 2021 +0200 @@ -29,6 +29,8 @@ val Def_File = new Properties.String(Markup.DEF_FILE) val Def_Id = new Properties.Long(Markup.DEF_ID) + val Def_Theory = new Properties.Long(Markup.DEF_THEORY) + object Line_File { def apply(line: Int, file: String): T = diff -r 839a6e284545 -r be49c660ebbf src/Pure/PIDE/markup.ML --- a/src/Pure/PIDE/markup.ML Tue Sep 07 21:47:50 2021 +0200 +++ b/src/Pure/PIDE/markup.ML Tue Sep 07 22:35:44 2021 +0200 @@ -64,6 +64,7 @@ val position_properties: string list val position_property: Properties.entry -> bool val def_name: string -> string + val def_theoryN: string val expressionN: string val expression: string -> T val citationN: string val citation: string -> T val pathN: string val path: string -> T @@ -413,6 +414,8 @@ SOME b => b | NONE => make_def a); +val def_theoryN = "def_theory"; + (* expression *) diff -r 839a6e284545 -r be49c660ebbf src/Pure/PIDE/markup.scala --- a/src/Pure/PIDE/markup.scala Tue Sep 07 21:47:50 2021 +0200 +++ b/src/Pure/PIDE/markup.scala Tue Sep 07 22:35:44 2021 +0200 @@ -159,6 +159,8 @@ val DEF_FILE = "def_file" val DEF_ID = "def_id" + val DEF_THEORY = "def_theory" + val POSITION = "position" val POSITION_PROPERTIES = Set(LINE, OFFSET, END_OFFSET, FILE, ID)