| author | blanchet |
| Mon, 04 Nov 2013 16:53:43 +0100 | |
| changeset 54246 | 8fdb4dc08ed1 |
| parent 53872 | 6e69f9ca8f1c |
| child 54310 | 6ddeb83eb67a |
| permissions | -rw-r--r-- |
| 52981 | 1 |
/* Title: Pure/PIDE/query_operation.scala |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
3 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
4 |
One-shot query operations via asynchronous print functions and temporary |
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
5 |
document overlays. |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
6 |
*/ |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
7 |
|
| 52981 | 8 |
package isabelle |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
9 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
10 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
11 |
import scala.actors.Actor._ |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
12 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
13 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
14 |
object Query_Operation |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
15 |
{
|
| 52935 | 16 |
object Status extends Enumeration |
17 |
{
|
|
18 |
val WAITING = Value("waiting")
|
|
19 |
val RUNNING = Value("running")
|
|
20 |
val FINISHED = Value("finished")
|
|
|
53872
6e69f9ca8f1c
explicit Status.REMOVED, which is required e.g. for sledgehammer to retrieve command of sendback exec_id (in contrast to find_theorems, see c2da0d3b974d);
wenzelm
parents:
53844
diff
changeset
|
21 |
val REMOVED = Value("removed")
|
| 52935 | 22 |
} |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
23 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
24 |
|
| 52980 | 25 |
class Query_Operation[Editor_Context]( |
26 |
editor: Editor[Editor_Context], |
|
27 |
editor_context: Editor_Context, |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
28 |
operation_name: String, |
| 52935 | 29 |
consume_status: Query_Operation.Status.Value => Unit, |
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
30 |
consume_output: (Document.Snapshot, Command.Results, XML.Body) => Unit) |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
31 |
{
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
32 |
private val instance = Document_ID.make().toString |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
33 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
34 |
|
| 52877 | 35 |
/* implicit state -- owned by Swing thread */ |
| 52874 | 36 |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
37 |
private var current_location: Option[Command] = None |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
38 |
private var current_query: List[String] = Nil |
| 52876 | 39 |
private var current_update_pending = false |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
40 |
private var current_output: List[XML.Tree] = Nil |
|
53872
6e69f9ca8f1c
explicit Status.REMOVED, which is required e.g. for sledgehammer to retrieve command of sendback exec_id (in contrast to find_theorems, see c2da0d3b974d);
wenzelm
parents:
53844
diff
changeset
|
41 |
private var current_status = Query_Operation.Status.REMOVED |
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
42 |
private var current_exec_id = Document_ID.none |
| 52876 | 43 |
|
44 |
private def reset_state() |
|
45 |
{
|
|
46 |
current_location = None |
|
47 |
current_query = Nil |
|
48 |
current_update_pending = false |
|
49 |
current_output = Nil |
|
|
53872
6e69f9ca8f1c
explicit Status.REMOVED, which is required e.g. for sledgehammer to retrieve command of sendback exec_id (in contrast to find_theorems, see c2da0d3b974d);
wenzelm
parents:
53844
diff
changeset
|
50 |
current_status = Query_Operation.Status.REMOVED |
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
51 |
current_exec_id = Document_ID.none |
| 52876 | 52 |
} |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
53 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
54 |
private def remove_overlay() |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
55 |
{
|
|
52977
15254e32d299
central management of Document.Overlays, independent of Document_Model;
wenzelm
parents:
52974
diff
changeset
|
56 |
current_location.foreach(command => |
|
15254e32d299
central management of Document.Overlays, independent of Document_Model;
wenzelm
parents:
52974
diff
changeset
|
57 |
editor.remove_overlay(command, operation_name, instance :: current_query)) |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
58 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
59 |
|
| 52877 | 60 |
|
61 |
/* content update */ |
|
62 |
||
63 |
private def content_update() |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
64 |
{
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
65 |
Swing_Thread.require() |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
66 |
|
| 52876 | 67 |
|
68 |
/* snapshot */ |
|
69 |
||
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
70 |
val (snapshot, state, removed) = |
| 52876 | 71 |
current_location match {
|
72 |
case Some(cmd) => |
|
| 52974 | 73 |
val snapshot = editor.node_snapshot(cmd.node_name) |
| 52876 | 74 |
val state = snapshot.state.command_state(snapshot.version, cmd) |
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
75 |
val removed = !snapshot.version.nodes(cmd.node_name).commands.contains(cmd) |
|
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
76 |
(snapshot, state, removed) |
| 52876 | 77 |
case None => |
| 52972 | 78 |
(Document.Snapshot.init, Command.empty.init_state, true) |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
79 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
80 |
|
| 52876 | 81 |
val results = |
82 |
(for {
|
|
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
83 |
(_, elem @ XML.Elem(Markup(Markup.RESULT, props), _)) <- state.results.entries |
| 52876 | 84 |
if props.contains((Markup.INSTANCE, instance)) |
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
85 |
} yield elem).toList |
| 52876 | 86 |
|
87 |
||
88 |
/* output */ |
|
89 |
||
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
90 |
val new_output = |
| 52876 | 91 |
for {
|
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
92 |
XML.Elem(_, List(XML.Elem(markup, body))) <- results |
| 52876 | 93 |
if Markup.messages.contains(markup.name) |
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
94 |
} yield XML.Elem(Markup(Markup.message(markup.name), markup.properties), body) |
| 52876 | 95 |
|
96 |
||
97 |
/* status */ |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
98 |
|
| 52935 | 99 |
def get_status(name: String, status: Query_Operation.Status.Value) |
100 |
: Option[Query_Operation.Status.Value] = |
|
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
101 |
results.collectFirst({ case XML.Elem(_, List(elem: XML.Elem)) if elem.name == name => status })
|
| 52876 | 102 |
|
103 |
val new_status = |
|
|
53872
6e69f9ca8f1c
explicit Status.REMOVED, which is required e.g. for sledgehammer to retrieve command of sendback exec_id (in contrast to find_theorems, see c2da0d3b974d);
wenzelm
parents:
53844
diff
changeset
|
104 |
if (removed) Query_Operation.Status.REMOVED |
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
105 |
else |
| 52935 | 106 |
get_status(Markup.FINISHED, Query_Operation.Status.FINISHED) orElse |
107 |
get_status(Markup.RUNNING, Query_Operation.Status.RUNNING) getOrElse |
|
108 |
Query_Operation.Status.WAITING |
|
| 52876 | 109 |
|
| 52935 | 110 |
if (new_status == Query_Operation.Status.RUNNING) |
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
111 |
results.collectFirst( |
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
112 |
{
|
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
113 |
case XML.Elem(Markup(_, Position.Id(id)), List(elem: XML.Elem)) |
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
114 |
if elem.name == Markup.RUNNING => id |
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
115 |
}).foreach(id => current_exec_id = id) |
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
116 |
|
| 52876 | 117 |
|
118 |
/* state update */ |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
119 |
|
| 52876 | 120 |
if (current_output != new_output || current_status != new_status) {
|
121 |
if (snapshot.is_outdated) |
|
122 |
current_update_pending = true |
|
123 |
else {
|
|
| 52877 | 124 |
current_update_pending = false |
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
125 |
if (current_output != new_output && !removed) {
|
| 52877 | 126 |
current_output = new_output |
|
52932
eb7d7c0034b5
removed command location is considered finished, and its overlay removed eventually;
wenzelm
parents:
52931
diff
changeset
|
127 |
consume_output(snapshot, state.results, new_output) |
| 52877 | 128 |
} |
129 |
if (current_status != new_status) {
|
|
130 |
current_status = new_status |
|
| 52935 | 131 |
consume_status(new_status) |
|
53872
6e69f9ca8f1c
explicit Status.REMOVED, which is required e.g. for sledgehammer to retrieve command of sendback exec_id (in contrast to find_theorems, see c2da0d3b974d);
wenzelm
parents:
53844
diff
changeset
|
132 |
if (new_status == Query_Operation.Status.REMOVED) {
|
| 52877 | 133 |
remove_overlay() |
| 52974 | 134 |
editor.flush() |
| 52876 | 135 |
} |
| 52877 | 136 |
} |
| 52876 | 137 |
} |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
138 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
139 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
140 |
|
| 52877 | 141 |
|
|
52931
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
142 |
/* query operations */ |
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
143 |
|
|
ac6648c0c0fb
cancel_query via direct access to the exec_id of the running query process;
wenzelm
parents:
52890
diff
changeset
|
144 |
def cancel_query(): Unit = |
|
52971
31926d2c04ee
tuned signature -- more abstract PIDE editor operations;
wenzelm
parents:
52935
diff
changeset
|
145 |
Swing_Thread.require { editor.session.cancel_exec(current_exec_id) }
|
| 52877 | 146 |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
147 |
def apply_query(query: List[String]) |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
148 |
{
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
149 |
Swing_Thread.require() |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
150 |
|
| 52980 | 151 |
editor.current_node_snapshot(editor_context) match {
|
| 52978 | 152 |
case Some(snapshot) => |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
153 |
remove_overlay() |
| 52876 | 154 |
reset_state() |
| 52972 | 155 |
consume_output(Document.Snapshot.init, Command.Results.empty, Nil) |
| 52980 | 156 |
editor.current_command(editor_context, snapshot) match {
|
|
53844
71f103629327
skip ignored commands, similar to former proper_command_at (see d68ea01d5084) -- relevant to Output, Query_Operation etc.;
wenzelm
parents:
53840
diff
changeset
|
157 |
case Some(command) => |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
158 |
current_location = Some(command) |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
159 |
current_query = query |
| 52935 | 160 |
current_status = Query_Operation.Status.WAITING |
|
52977
15254e32d299
central management of Document.Overlays, independent of Document_Model;
wenzelm
parents:
52974
diff
changeset
|
161 |
editor.insert_overlay(command, operation_name, instance :: query) |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
162 |
case None => |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
163 |
} |
| 52935 | 164 |
consume_status(current_status) |
| 52974 | 165 |
editor.flush() |
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
166 |
case None => |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
167 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
168 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
169 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
170 |
def locate_query() |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
171 |
{
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
172 |
Swing_Thread.require() |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
173 |
|
| 52980 | 174 |
for {
|
175 |
command <- current_location |
|
176 |
snapshot = editor.node_snapshot(command.node_name) |
|
177 |
link <- editor.hyperlink_command(snapshot, command) |
|
178 |
} link.follow(editor_context) |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
179 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
180 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
181 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
182 |
/* main actor */ |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
183 |
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
184 |
private val main_actor = actor {
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
185 |
loop {
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
186 |
react {
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
187 |
case changed: Session.Commands_Changed => |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
188 |
current_location match {
|
| 52876 | 189 |
case Some(command) |
190 |
if current_update_pending || |
|
|
53872
6e69f9ca8f1c
explicit Status.REMOVED, which is required e.g. for sledgehammer to retrieve command of sendback exec_id (in contrast to find_theorems, see c2da0d3b974d);
wenzelm
parents:
53844
diff
changeset
|
191 |
(current_status != Query_Operation.Status.REMOVED && |
| 52935 | 192 |
changed.commands.contains(command)) => |
| 52877 | 193 |
Swing_Thread.later { content_update() }
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
194 |
case _ => |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
195 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
196 |
case bad => |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
197 |
java.lang.System.err.println("Query_Operation: ignoring bad message " + bad)
|
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
198 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
199 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
200 |
} |
|
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
201 |
|
| 53840 | 202 |
def activate() {
|
203 |
editor.session.commands_changed += main_actor |
|
204 |
} |
|
| 53000 | 205 |
|
206 |
def deactivate() {
|
|
207 |
editor.session.commands_changed -= main_actor |
|
208 |
remove_overlay() |
|
209 |
} |
|
|
52865
02a7e7180ee5
slightly more general support for one-shot query operations via asynchronous print functions and temporary document overlay;
wenzelm
parents:
diff
changeset
|
210 |
} |