src/Pure/PIDE/sendback.ML
author wenzelm
Thu, 22 Nov 2012 14:40:39 +0100
changeset 50164 77668b522ffe
parent 50163 c62ce309dc26
child 50172 1a28109edc6d
permissions -rw-r--r--
some support for implicit senback, meaning that it uses the caret position instead of explicit command exec_id;

(*  Title:      Pure/PIDE/sendback.ML
    Author:     Makarius

Clickable "sendback" areas within the source text (see also
Tools/jEdit/src/sendback.scala).
*)

signature SENDBACK =
sig
  val make_markup: unit -> Markup.T
  val markup: string -> string
  val markup_implicit: string -> string
end;

structure Sendback: SENDBACK =
struct

fun make_markup () =
  let
    val props =
      (case Position.get_id (Position.thread_data ()) of
        SOME id => [(Isabelle_Markup.idN, id)]
      | NONE => []);
  in Markup.properties props Isabelle_Markup.sendback end;

fun markup s = Markup.markup (make_markup ()) s;

val markup_implicit = Markup.markup Isabelle_Markup.sendback;

end;