DEF_CMD(doc_request_notify)
{
struct doc *d = ci->home->data;
- pane_add_notify(ci->focus, ci->home, ci->key+8);
+
+ /* Key starts "doc:Request:Notify:" */
+ pane_add_notify(ci->focus, ci->home, ci->key+12);
return d->filter ? 0 : 1;
}
DEF_CMD(doc_notify)
{
- int ret = home_pane_notify(ci->home, ci->key + 5, ci->focus, ci->num, ci->mark, ci->str,
- ci->num2, ci->mark2, ci->str2, ci->comm2);
+ /* Key is "doc:Notify:..." */
+ int ret = home_pane_notify(ci->home, ci->key + 4, ci->focus,
+ ci->num, ci->mark, ci->str,
+ ci->num2, ci->mark2, ci->str2, ci->comm2);
/* Mustn't return 0, else will fall through to next doc */
return ret ?: Enotarget;
}
doc_handle_cmd = key_alloc();
key_add_range(doc_handle_cmd, "doc:", "doc;", &doc_pass_on);
- key_add_range(doc_handle_cmd, "Request:Notify:doc:", "Request:Notify:doc;", &doc_pass_on);
- key_add_range(doc_handle_cmd, "Call:Notify:doc:", "Call:Notify:doc;", &doc_pass_on);
key_add(doc_handle_cmd, "Move-Char", &doc_char);
key_add(doc_handle_cmd, "Move-Word", &doc_word);
key_add(doc_default_cmd, "doc:push-point", &doc_push_point);
key_add(doc_default_cmd, "doc:pop-point", &doc_pop_point);
- key_add_range(doc_default_cmd, "Request:Notify:doc:", "Request:Notify:doc;",
+ key_add_range(doc_default_cmd, "doc:Request:Notify:", "doc:Request:Notify;",
&doc_request_notify);
- key_add_range(doc_default_cmd, "Call:Notify:doc:", "Call:Notify:doc;",
+ key_add_range(doc_default_cmd, "doc:Notify:", "doc:Notify;",
&doc_notify);
key_add_range(doc_default_cmd, "doc:set:", "doc:set;",
&doc_set);
if (strcmp(ci->key, "docs:show-modified") == 0) {
p = doc_attach_view(ci->focus, doc->doc.home, NULL, NULL, 1);
p = pane_register(p, 0, &docs_modified_handle.c, doc, NULL);
- call("Request:Notify:doc:Replace", p);
+ call("doc:Request:Notify:doc:Replace", p);
/* And trigger Notify:doc:Replace handling immediately...*/
pane_call(p, "Notify:doc:Replace", p);
/* Don't want to inherit position from some earlier instance,
/* The docs doc is attached separately */
return Efallthrough;
home_call(p, "doc:set-parent", doc->collection);
- home_call(p, "Request:Notify:doc:status-changed", doc->collection);
+ home_call(p, "doc:Request:Notify:doc:status-changed", doc->collection);
if (p->parent)
doc_checkname(p, doc, ci->num);
return Efallthrough;
change_part(mpi, ci->mark, n, 0);
pane_add_notify(ci->home, ci->focus, "Notify:Close");
- home_call(ci->focus, "Request:Notify:doc:viewers", ci->home);
+ home_call(ci->focus, "doc:Request:Notify:doc:viewers", ci->home);
return 1;
}
}
}
t->saved = t->undo;
- call("Call:Notify:doc:status-changed", ci->home);
+ call("doc:Notify:doc:status-changed", ci->home);
pane_notify("Notify:doc:Replace", t->doc.home);
if (fd != ci->num2)
close(fd);
call("Message", ci->focus, 0, NULL, msg);
free(msg);
if (change_status)
- call("Call:Notify:doc:status-changed", d->home);
+ call("doc:Notify:doc:status-changed", d->home);
text_check_autosave(t);
if (ret == 0)
return 1;
text_check_consistent(t);
if (status != (t->undo == t->saved))
- call("Call:Notify:doc:status-changed", t->doc.home);
+ call("doc:Notify:doc:status-changed", t->doc.home);
text_check_autosave(t);
/* Point probably moved, so */
}
text_check_autosave(t);
if (status_change)
- call("Call:Notify:doc:status-changed", d->home);
+ call("doc:Notify:doc:status-changed", d->home);
pane_notify("Notify:doc:Replace", t->doc.home, 0, pm, NULL,
0, early);
if (!ci->mark2)
else
t->saved = t->undo;
text_check_autosave(t);
- call("Call:Notify:doc:status-changed", d->home);
+ call("doc:Notify:doc:status-changed", d->home);
return 1;
}
if (ci->mark && doc_following_pane(ci->focus, ci->mark) != WEOF)
return 0;
esi->case_sensitive = !esi->case_sensitive;
- call("Call:Notify:doc:Replace", ci->focus);
+ call("doc:Notify:doc:Replace", ci->focus);
attr_set_str(&ci->home->attrs, "status-line",
esi->case_sensitive ? " Search: case sensitive " :
" Search: case insensitive ");
p = pane_register(ci->focus, 0, &search_handle.c, esi, NULL);
if (p) {
- call("Request:Notify:doc:Replace", p);
+ call("doc:Request:Notify:doc:Replace", p);
attr_set_str(&p->attrs, "status-line", " Search: case insensitive ");
comm_call(ci->comm2, "callback:attach", p);
}
buf_init(&hi->search);
p = pane_register(ci->focus, 0, &hi->handle.c, hi, NULL);
pane_add_notify(p, hi->history, "Notify:Close");
- call("Request:Notify:doc:Replace", p);
+ call("doc:Request:Notify:doc:Replace", p);
return comm_call(ci->comm2, "callback:attach", p);
}
DEF_CMD(count_lines)
{
/* FIXME optimise this away most of the time */
- if (call("Call:Notify:doc:CountLines", ci->focus) == 0) {
+ if (call("doc:Notify:doc:CountLines", ci->focus) == 0) {
/* No counter in place, add one */
struct count_info *cli;
struct pane *p;
cli = calloc(1, sizeof(*cli));
p = pane_register(NULL, 0, &handle_count_lines.c, cli, NULL);
cli->view_num = home_call(ci->focus, "doc:add-view", p) - 1;
- home_call(ci->focus, "Request:Notify:doc:Replace", p);
- home_call(ci->focus, "Request:Notify:doc:CountLines", p);
- home_call(ci->focus, "Request:Notify:doc:GotoLine", p);
- call("Call:Notify:doc:CountLines", ci->focus, 1, ci->mark);
+ home_call(ci->focus, "doc:Request:Notify:doc:Replace", p);
+ home_call(ci->focus, "doc:Request:Notify:doc:CountLines", p);
+ home_call(ci->focus, "doc:Request:Notify:doc:GotoLine", p);
+ call("doc:Notify:doc:CountLines", ci->focus, 1, ci->mark);
}
if (ci->mark) {
if (ci->str && strcmp(ci->str, "goto:line") == 0 &&
ci->num != NO_NUMERIC) {
- call("Call:Notify:doc:GotoLine", ci->focus, ci->num, NULL, NULL,
+ call("doc:Notify:doc:GotoLine", ci->focus, ci->num, NULL, NULL,
0, ci->mark);
}
- call("Call:Notify:doc:CountLines", ci->focus, 0, NULL, NULL,
+ call("doc:Notify:doc:CountLines", ci->focus, 0, NULL, NULL,
0, ci->mark);
}
if (ci->mark2)
- call("Call:Notify:doc:CountLines", ci->focus, 0, NULL, NULL,
+ call("doc:Notify:doc:CountLines", ci->focus, 0, NULL, NULL,
0, ci->mark2);
return 1;
}
p = pane_register(par, 0, &view_handle.c, vd, NULL);
/* Capture status-changed notification so we can update 'changed' flag in
* status line */
- call("Request:Notify:doc:status-changed", p);
+ call("doc:Request:Notify:doc:status-changed", p);
pane_damaged(p, DAMAGED_SIZE);
return p;
}
else:
self.sock.send("No Display!")
return 1
- if msg[:24] == "Request:Notify:doc:done:":
- path = msg[24:]
+ if msg[:28] == "doc:Request:Notify:doc:done:":
+ path = msg[28:]
d = editor.call("doc:open", -1, path, ret="focus")
if not d:
self.sock.send("FAIL")
if ret != "OK":
print "Cannot open: ", ret
sys.exit(1)
- s.send("Request:Notify:doc:done:"+file)
+ s.send("doc:Request:Notify:doc:done:"+file)
else:
s.send("Request:Notify:Close")
ret = s.recv(100)
ServerPane(new)
def server_done(key, focus, **a):
- ret = focus.call("Call:Notify:doc:done", "test")
+ ret = focus.call("doc:Notify:doc:done", "test")
if ret > 0:
# maybe save, then notify properly
fn = focus["filename"]
if fn and mod == "yes":
focus.call("Message", "Please save first!")
else:
- focus.call("Call:Notify:doc:done")
+ focus.call("doc:Notify:doc:done")
# FIXME need something better than 'bury'
# If it was already visible, it should stay that way
focus.call("Window:bury")
self['background'] = 'color:#A0FFFF'
self['line-format'] = '<%fmt>%count %+name</>'
self.call("notmuch:set_list_pane")
- self.call("Request:Notify:doc:Replace")
+ self.call("doc:Request:Notify:doc:Replace")
self.selected = None
def handle_clone(self, key, focus, **a):
self.thread_start = None
self.thread_end = None
self.thread_matched = None
- self.call("Request:Notify:doc:Replace")
+ self.call("doc:Request:Notify:doc:Replace")
def handle_clone(self, key, focus, mark, mark2, num, num2, str, comm2, **a):
"handle:Clone"
"handle:Display:refresh"
# Refresh causes presentation page to recenter
# page-down just moves down to start of next page.
- focus.call("Call:Notify:doc:Recentre", mark)
+ focus.call("doc:Notify:doc:Recentre", mark)
return 0
def handle_mvl(self, key, focus, mark, num, **a):
"handle:Move-View-Large"
if num >= 0 and mark:
m2 = mark.dup()
- if focus.call("Call:Notify:doc:Recentre", m2, 2,
+ if focus.call("doc:Notify:doc:Recentre", m2, 2,
lambda key, **a: mark.to_mark(a['mark'])) > 0:
focus.damaged(edlib.DAMAGED_CURSOR)
return 1
if num < 0 and mark:
m2 = mark.dup()
- if focus.call("Call:Notify:doc:Recentre", m2, 3,
+ if focus.call("doc:Notify:doc:Recentre", m2, 3,
lambda key, **a: mark.to_mark(a['mark'])) > 0:
focus.damaged(edlib.DAMAGED_CURSOR)
return 1
p['background'] = 'color:yellow'
p['hide-cursor'] = 'yes'
- p.call("Request:Notify:doc:Replace")
- p.call("Request:Notify:doc:Recentre")
+ p.call("doc:Request:Notify:doc:Replace")
+ p.call("doc:Request:Notify:doc:Recentre")
comm2("callback", p)
return 1
render_hex_register_map();
p = pane_register(parent, 0, &render_hex_handle.c, he, NULL);
- call("Request:Notify:doc:Replace", p);
+ call("doc:Request:Notify:doc:Replace", p);
attr_set_str(&p->attrs, "render-wrap", "no");
attr_set_str(&p->attrs, "heading", "<bold> 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff 0 1 2 3 4 5 6 7 8 9 a b c d e f</>");
he->pane = p;
p = call_ret(pane, "attach-renderline", p);
p = pane_register(p, 0, &render_lines_handle.c, rl, NULL);
rl->typenum = home_call(ci->focus, "doc:add-view", p) - 1;
- call("Request:Notify:doc:Replace", p);
+ call("doc:Request:Notify:doc:Replace", p);
return comm_call(ci->comm2, "callback:attach", p);
}