| author | wenzelm |
| Wed, 28 Nov 2012 16:07:17 +0100 | |
| changeset 50253 | 41fd9f68614b |
| parent 50215 | 97959912840a |
| permissions | -rw-r--r-- |
|
50163
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
1 |
(* Title: Pure/PIDE/sendback.ML |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
3 |
|
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
4 |
Clickable "sendback" areas within the source text (see also |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
5 |
Tools/jEdit/src/sendback.scala). |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
6 |
*) |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
7 |
|
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
8 |
signature SENDBACK = |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
9 |
sig |
| 50215 | 10 |
val make_markup: {implicit: bool, properties: Properties.T} -> Markup.T
|
| 50212 | 11 |
val markup_implicit: string -> string |
|
50163
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
12 |
val markup: string -> string |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
13 |
end; |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
14 |
|
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
15 |
structure Sendback: SENDBACK = |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
16 |
struct |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
17 |
|
| 50215 | 18 |
fun make_markup {implicit, properties} =
|
19 |
Markup.sendback |
|
20 |
|> not implicit ? (fn markup => |
|
21 |
let |
|
22 |
val props = |
|
23 |
(case Position.get_id (Position.thread_data ()) of |
|
24 |
SOME id => [(Markup.idN, id)] |
|
25 |
| NONE => []); |
|
26 |
in Markup.properties props markup end) |
|
27 |
|> Markup.properties properties; |
|
|
50163
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
28 |
|
| 50215 | 29 |
fun markup_implicit s = Markup.markup (make_markup {implicit = true, properties = []}) s;
|
30 |
fun markup s = Markup.markup (make_markup {implicit = false, properties = []}) s;
|
|
|
50164
77668b522ffe
some support for implicit senback, meaning that it uses the caret position instead of explicit command exec_id;
wenzelm
parents:
50163
diff
changeset
|
31 |
|
|
50163
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
32 |
end; |
|
c62ce309dc26
more abstract Sendback operations, with explicit id/exec_id properties;
wenzelm
parents:
diff
changeset
|
33 |