at 'mark' or ends at 'mark2'. 'num' gives the length in characters,
but if this length extends to another line, it may not be honoured.
+
+# Documents
+
+## doc:request:FOO
+
+Request that when the document sends notification "FOO", it gets sent
+to the provided focus.
+
+## doc:notify:FOO
+
+Request that the document sends notification FOO.
}
if (strcmp(val, "readonly") == 0) {
d->readonly = ci->num;
- call("doc:Notify:doc:status-changed", d->home);
+ call("doc:notify:doc:status-changed", d->home);
return 1;
}
if (ci->str)
return Enoarg;
free(d->name);
d->name = strdup(ci->str);
- return call("doc:Notify:doc:revisit", d->home, ci->num);
+ return call("doc:notify:doc:revisit", d->home, ci->num);
}
DEF_CMD(doc_request_notify)
{
- /* Key starts "doc:Request:Notify:" */
- pane_add_notify(ci->focus, ci->home, ci->key+12);
+ /* Key starts "doc:request:" */
+ pane_add_notify(ci->focus, ci->home, ci->key + 12);
return 1;
}
DEF_CMD(doc_notify)
{
- /* Key is "doc:Notify:..." */
- int ret = home_pane_notify(ci->home, ci->key + 4, ci->home,
+ /* Key is "doc:notify:..." */
+ int ret = home_pane_notify(ci->home, ci->key + 11, ci->home,
ci->num, ci->mark, ci->str,
ci->num2, ci->mark2, ci->str2, ci->comm2);
return ret;
/* If there are any doc-displays open, then will return '1' and
* we will know not to destroy document yet.
*/
- ret = pane_notify("Notify:doc:viewers", p);
+ ret = pane_notify("doc:notify-viewers", p);
if (ret == 0)
call("doc:drop-cache", p);
return 1;
return Efail;
do_doc_assign(p, doc);
- call("doc:Notify:doc:revisit", p, ci->num);
+ call("doc:notify:doc:revisit", p, ci->num);
if (strcmp(type, "invisible") != 0) {
/* Attach renderer */
p2 = call_ret(pane, "attach-view", p);
key_add(doc_handle_cmd, "Move-View-Large", &doc_page);
key_add(doc_handle_cmd, "doc:point", &doc_get_point);
- key_add(doc_handle_cmd, "Notify:doc:viewers", &doc_notify_viewers);
+ key_add(doc_handle_cmd, "doc:notify-viewers", &doc_notify_viewers);
key_add(doc_handle_cmd, "Notify:Close", &doc_notify_close);
key_add(doc_handle_cmd, "Notify:point:moved", &doc_notify_moved);
key_add(doc_handle_cmd, "Refresh", &doc_refresh);
key_add(doc_default_cmd, "doc:pop-point", &doc_pop_point);
key_add(doc_default_cmd, "doc:attach-view", &doc_attach_view);
- key_add_prefix(doc_default_cmd, "doc:Request:Notify:",
+ key_add_prefix(doc_default_cmd, "doc:request:",
&doc_request_notify);
- key_add_prefix(doc_default_cmd, "doc:Notify:", &doc_notify);
+ key_add_prefix(doc_default_cmd, "doc:notify:", &doc_notify);
key_add_prefix(doc_default_cmd, "doc:set:", &doc_set);
}
if (!m)
return;
if (call("doc:pop-point", doc, 0, m) <= 0)
- pane_notify("Notify:doc:viewers", doc, 0, m);
+ pane_notify("doc:notify-viewers", doc, 0, m);
dd->doc = doc;
dd->point = m;
attr_set_str(&m->attrs, "render:interactive-point", "yes");
pane_add_notify(p, doc, "Notify:Close");
- pane_add_notify(p, doc, "Notify:doc:viewers");
+ pane_add_notify(p, doc, "doc:notify-viewers");
pane_add_notify(p, doc, "Notify:point:moved");
- call("doc:Notify:doc:revisit", doc, 0);
+ call("doc:notify:doc:revisit", doc, 0);
}
static struct pane *safe doc_attach(struct pane *parent)
list_del(&de->lst);
free(de);
if (m && donotify) {
- pane_notify("Notify:doc:Replace", ci->home,
+ pane_notify("doc:replaced", ci->home,
0, prev);
- pane_notify("Notify:doc:Replace", ci->home,
+ pane_notify("doc:replaced", ci->home,
0, m);
}
} else if (de2 &&
else
list_add_tail(&de2->lst, &dr->ents);
if (m && donotify) {
- pane_notify("Notify:doc:Replace", ci->home,
+ pane_notify("doc:replaced", ci->home,
0, prev);
- pane_notify("Notify:doc:Replace", ci->home,
+ pane_notify("doc:replaced", ci->home,
0, m);
}
} else if (de1 /*FIXME should be assumed */) {
if (!donotify) {
m = doc_first_mark_all(&dr->doc);
if (m)
- pane_notify("Notify:doc:Replace", ci->home, 0, m);
+ pane_notify("doc:replaced", ci->home, 0, m);
}
if (name) {
key_add(doc_map, "doc:step", &dir_step);
key_add(doc_map, "doc:replace", &dir_cmd);
key_add(doc_map, "doc:attach-view", &dir_attach);
- key_add(doc_map, "doc:Notify:doc:revisit", &dir_revisited);
+ key_add(doc_map, "doc:notify:doc:revisit", &dir_revisited);
key_add(doc_map, "get-attr", &dir_get_attr);
key_add(doc_map, "Notify:Close", &dir_notify_close);
* providing a "line-format" to guide display of each line.
* The auxiliary pane becomes the parent of all attached documents, so
* that the list of children is exactly the content of the document.
- * This pane receives Notify:doc:revisit notification from the
+ * This pane receives doc:revisit notification from the
* individual documents, and also requests notification of
- * Notify:doc:status-changed.
+ * doc:status-changed.
*
* Supported global operations include:
* docs:byname - report pane with given (str)name
m->ref.p = NULL;
else
m->ref.p = list_next_entry(p, siblings);
- pane_notify("Notify:doc:Replace", doc->doc.home, 0, m);
+ pane_notify("doc:replaced", doc->doc.home, 0, m);
}
}
m = doc_next_mark_all(m))
if (m->ref.p == next) {
m->ref.p = p;
- pane_notify("Notify:doc:Replace", doc->doc.home, 0, m);
+ pane_notify("doc:replaced", doc->doc.home, 0, m);
}
}
/* The docs doc is attached separately */
return Efallthrough;
pane_reparent(p, doc->collection);
- home_call(p, "doc:Request:Notify:doc:revisit", doc->collection);
- home_call(p, "doc:Request:Notify:doc:status-changed",
+ home_call(p, "doc:request:doc:revisit", doc->collection);
+ home_call(p, "doc:request:doc:status-changed",
doc->collection);
if (p->parent)
doc_checkname(p, doc, ci->num ?: -1);
return Enoarg;
do {
if (m->ref.p == child) {
- pane_notify("Notify:doc:Replace", d->home, 0, m);
+ pane_notify("doc:replaced", d->home, 0, m);
break;
}
} while (mark_next(d, m) != WEOF);
if (!tile)
return 1;
/* Discourage this doc from being chosen again */
- call("doc:Notify:doc:revisit", focus, -1);
+ call("doc:notify:doc:revisit", focus, -1);
doc = call_ret(pane, "docs:choose", focus);
if (doc)
home_call(doc, "doc:attach-view", tile);
//attr_set_str(&p->attrs, "done-key", "Replace");
p = pane_register(p, 0, &docs_modified_handle.c, docs);
- call("doc:Request:Notify:doc:Replace", p);
- /* And trigger Notify:doc:Replace
- * handling immediately...*/
- pane_call(p, "Notify:doc:Replace", p);
+ call("doc:request:doc:replaced", p);
+ /* And trigger doc:replaced handling immediately...*/
+ pane_call(p, "doc:replaced", p);
/* Don't want to inherit position from some
* earlier instance, always move to the start.
*/
key_add(docs_map, "get-attr", &docs_get_attr);
- key_add(docs_aux_map, "Notify:doc:revisit", &doc_revisit);
- key_add(docs_aux_map, "Notify:doc:status-changed", &doc_damage);
+ key_add(docs_aux_map, "doc:revisit", &doc_revisit);
+ key_add(docs_aux_map, "doc:status-changed", &doc_damage);
key_add(docs_aux_map, "ChildClosed", &docs_child_closed);
key_add(docs_modified_map, "doc:replace", &docs_modified_replace);
- key_add(docs_modified_map, "Notify:doc:Replace",
+ key_add(docs_modified_map, "doc:replaced",
&docs_modified_notify_replace);
key_add(docs_modified_map, "doc:step", &docs_modified_step);
key_add(docs_modified_map, "doc:get-attr", &docs_modified_doc_get_attr);
* doc:set-ref
* doc:step
* doc:get-attr doc:set-attr?
- * and might capture Notify:doc:revisit to hide??
+ * and might capture doc:revisit to hide??
* others are doc:load-file,same-file,save-file
* doc:replace doc:reundo doc:get-str doc:modified
*/
change_part(mpi, ci->mark, n, 0);
pane_add_notify(ci->home, ci->focus, "Notify:Close");
- home_call(ci->focus, "doc:Request:Notify:doc:viewers", ci->home);
+ home_call(ci->focus, "doc:request:doc:notify-viewers", ci->home);
return 1;
}
key_add(mp_map, "doc:step-part", &mp_step_part);
key_add(mp_map, "Close", &mp_close);
key_add(mp_map, "Notify:Close", &mp_notify_close);
- key_add(mp_map, "Notify:doc:viewers", &mp_notify_viewers);
+ key_add(mp_map, "doc:notify-viewers", &mp_notify_viewers);
key_add(mp_map, "multipart-add", &mp_add);
key_add_prefix(mp_map, "multipart-this:", &mp_forward);
key_add_prefix(mp_map, "multipart-next:", &mp_forward);
m->mdata = NULL;
m = vmark_next(m);
}
- pane_notify("Notify:doc:Replace", ci->home);
+ pane_notify("doc:replaced", ci->home);
return 1;
}
key_add(dr_map, "doc:set-ref", &dr_set_ref);
key_add(dr_map, "doc:step", &dr_step);
key_add(dr_map, "Close", &dr_close);
- key_add(dr_map, "Notify:doc:viewers", &dr_notify_viewers);
- key_add(dr_map, "Notify:doc:Replace", &dr_notify_replace);
+ key_add(dr_map, "doc:notify-viewers", &dr_notify_viewers);
+ key_add(dr_map, "doc:replaced", &dr_notify_replace);
key_add(dr_map, "Notify:Close", &dr_notify_close);
- key_add(dr_map, "doc:Notify:doc:revisit", &dr_revisit);
+ key_add(dr_map, "doc:revisit", &dr_revisit);
key_add(dr_map, "doc:render-line", &dr_render_line);
key_add(dr_map, "doc:render-line-prev", &dr_render_prev);
key_add(dr_map, "doc:replace", &dr_replace);
dri->doc.refcnt = dr_refcnt;
dri->base = ci->focus;
- home_call(ci->focus, "doc:Request:Notify:doc:viewers", p);
- home_call(ci->focus, "doc:Request:Notify:doc:Replace", p);
+ home_call(ci->focus, "doc:request:doc:notify-viewers", p);
+ home_call(ci->focus, "doc:request:doc:replaced", p);
pane_add_notify(p, ci->focus, "Notify:Close");
- home_call(ci->focus, "doc:Request:Notify:Close", p);
+ home_call(ci->focus, "doc:request:Notify:Close", p);
//call("doc:set:autoclose", p, 1);
dri->vnum = home_call(ci->focus, "doc:add-view", p) - 1;
st.st_mtime != t->stat.st_mtime ||
st.st_mtim.tv_nsec != t->stat.st_mtim.tv_nsec) {
t->file_changed = 1;
- call("doc:Notify:doc:status-changed", t->doc.home);
+ call("doc:notify:doc:status-changed", t->doc.home);
return True;
}
return False;
}
t->saved = t->undo;
t->file_changed = 0;
- call("doc:Notify:doc:status-changed", ci->home);
- pane_notify("Notify:doc:Replace", t->doc.home);
+ call("doc:notify:doc:status-changed", ci->home);
+ pane_notify("doc:replaced", t->doc.home);
if (fd != ci->num2)
close(fd);
return 1;
call("Message", ci->focus, 0, NULL, msg);
free(msg);
if (change_status)
- call("doc:Notify:doc:status-changed", d->home);
+ call("doc:notify:doc:status-changed", d->home);
text_check_autosave(t);
if (ret == 0)
return 1;
struct text *t = container_of(d, struct text, doc);
if (t->undo == t->saved && check_file_changed(t) && !d->readonly) {
- call("doc:Notify:doc:status-changed", d->home);
+ call("doc:notify:doc:status-changed", d->home);
d->readonly = 1;
}
if (!d->readonly)
if (early && !text_ref_same(t, &early->ref, &start))
early = NULL;
- pane_notify("Notify:doc:Replace", t->doc.home,
+ pane_notify("doc:replaced", t->doc.home,
0, ci->mark, NULL,
0, early);
text_check_consistent(t);
if (status != (t->undo == t->saved))
- call("doc:Notify:doc:status-changed", t->doc.home);
+ call("doc:notify:doc:status-changed", t->doc.home);
text_check_autosave(t);
if (!ed)
}
text_check_autosave(t);
if (status_change)
- call("doc:Notify:doc:status-changed", d->home);
- pane_notify("Notify:doc:Replace", t->doc.home, 0, pm, NULL,
+ call("doc:notify:doc:status-changed", d->home);
+ pane_notify("doc:replaced", t->doc.home, 0, pm, NULL,
0, early);
if (!ci->mark2)
mark_free(pm);
c = list_next_entry(c, lst);
o = c->start;
}
- pane_notify("Notify:doc:Replace", ci->home, 0, ci->mark);
+ pane_notify("doc:replaced", ci->home, 0, ci->mark);
attr_set_str_key(&c->attrs, attr, val, o);
return Efallthrough;
}
else
t->saved = t->undo;
text_check_autosave(t);
- call("doc:Notify:doc:status-changed", d->home);
+ call("doc:notify:doc:status-changed", d->home);
return 1;
}
key_add(text_map, "doc:step-bytes", &text_step_bytes);
key_add(text_map, "doc:modified", &text_modified);
key_add(text_map, "doc:set:readonly", &text_readonly);
- key_add(text_map, "doc:Notify:doc:revisit", &text_revisited);
+ key_add(text_map, "doc:revisit", &text_revisited);
key_add(text_map, "Close", &text_destroy);
key_add(text_map, "get-attr", &text_get_attr);
if (ci->mark && doc_following_pane(ci->focus, ci->mark) != WEOF)
return 0;
esi->case_sensitive = !esi->case_sensitive;
- call("doc:Notify:doc:Replace", ci->focus);
+ call("doc:notify:doc:replaced", ci->focus);
attr_set_str(&ci->home->attrs, "status-line",
esi->case_sensitive ? " Search: case sensitive " :
" Search: case insensitive ");
key_add(es_map, "C-Chr-R", &search_forward);
key_add(es_map, "Close", &search_close);
key_add(es_map, "Enter", &search_done);
- key_add(es_map, "Notify:doc:Replace", &search_again);
+ key_add(es_map, "doc:replaced", &search_again);
key_add(es_map, "Notify:clip", &search_clip);
key_add(es_map, "C-Chr-L", &search_recentre);
key_add_range(es_map, "Chr- ", "Chr-~", &search_insert_quoted);
p = pane_register(ci->focus, 0, &search_handle.c, esi);
if (p) {
- call("doc:Request:Notify:doc:Replace", p);
+ call("doc:request:doc:replaced", 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);
pane_add_notify(p, hi->history, "Notify:Close");
- call("doc:Request:Notify:doc:Replace", p);
+ call("doc:request:doc:replaced", p);
return comm_call(ci->comm2, "callback:attach", p);
}
history_map = key_alloc();
key_add(history_map, "Close", &history_close);
key_add(history_map, "Notify:Close", &history_notify_close);
- key_add(history_map, "Notify:doc:Replace", &history_notify_replace);
+ key_add(history_map, "doc:replaced", &history_notify_replace);
key_add(history_map, "M-Chr-p", &history_move);
key_add(history_map, "M-Chr-n", &history_move);
}
DEF_CMD(count_lines)
{
/* FIXME optimise this away most of the time */
- if (call("doc: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);
cli->view_num = home_call(ci->focus, "doc:add-view", p) - 1;
- 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);
+ home_call(ci->focus, "doc:request:doc:replaced", p);
+ home_call(ci->focus, "doc:request:doc:CountLines", p);
+ home_call(ci->focus, "doc:request: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("doc:Notify:doc:GotoLine", ci->focus, ci->num, NULL, NULL,
+ call("doc:notify:doc:GotoLine", ci->focus, ci->num, NULL, NULL,
0, ci->mark);
}
- call("doc: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("doc:Notify:doc:CountLines", ci->focus, 0, NULL, NULL,
+ call("doc:notify:doc:CountLines", ci->focus, 0, NULL, NULL,
0, ci->mark2);
return 1;
}
linecount_map = key_alloc();
key_add(linecount_map, "Notify:Close", &linecount_close);
- key_add(linecount_map, "Notify:doc:Replace", &linecount_notify_replace);
- key_add(linecount_map, "Notify:doc:CountLines", &linecount_notify_count);
- key_add(linecount_map, "Notify:doc:GotoLine", &linecount_notify_goto);
+ key_add(linecount_map, "doc:replaced", &linecount_notify_replace);
+ key_add(linecount_map, "doc:CountLines", &linecount_notify_count);
+ key_add(linecount_map, "doc:GotoLine", &linecount_notify_goto);
key_add(linecount_map, "Notify:clip", &linecount_clip);
}
struct pane *doc;
/* First, push the doc to the end of the 'recently used' list */
- call("doc:Notify:doc:revisit", ci->focus, -1);
+ call("doc:notify:doc:revisit", ci->focus, -1);
/* Now choose a replacement */
doc = call_ret(pane, "docs:choose", ci->focus);
if (doc)
p = pane_register(par, 0, &view_handle.c, vd);
/* Capture status-changed notification so we can update 'changed' flag in
* status line */
- call("doc:Request:Notify:doc:status-changed", p);
+ call("doc:request:doc:status-changed", p);
pane_damaged(p, DAMAGED_SIZE);
return p;
}
key_add(view_map, "ChildRegistered", &view_child_registered);
key_add(view_map, "Refresh:size", &view_refresh_size);
key_add(view_map, "Refresh", &view_refresh);
- key_add(view_map, "Notify:doc:status-changed", &view_status_changed);
+ key_add(view_map, "doc:status-changed", &view_status_changed);
key_add(view_map, "render:reposition", &view_reposition);
key_add(view_map, "Notify:clip", &view_clip);
p = home_call_ret(pane, docp, "doc:attach-view", pop, -1, NULL, "complete");
if (!p)
return Efail;
- //call("doc:Notify:doc:revisit", p, -1);
+ //call("doc:notify:doc:revisit", p, -1);
cr = call_ret(all, "Complete:prefix", p, 1, NULL, b);
if (cr.s && (strlen(cr.s) <= strlen(b) && cr.ret-1 > 1)) {
def __init__(self, focus):
edlib.Pane.__init__(self, focus)
- self.call("doc:Request:Notify:doc:Replace")
- self.call("doc:Request:Notify:point:moved")
+ self.call("doc:request:doc:replaced")
+ self.call("doc:request:point:moved")
self.active = False
p = focus.call("doc:point", ret='mark')
self.prefix_end = p.dup()
return 1
def handle_activity(self, key, focus, **a):
- "handle-list/Notify:doc:Replace/Notify:point:moved/pane:defocus"
+ "handle-list/doc:replaced/Notify:point:moved/pane:defocus"
if not self.active:
self.call("view:changed", self.prefix_start, self.prefix_end)
self.call("editor-on-idle", self.delayed_close)
def __init__(self, focus):
edlib.Pane.__init__(self, focus)
self.add_notify(focus, "make-next")
- self.add_notify(focus, "Notify:doc:make-revisit");
+ self.add_notify(focus, "doc:make-revisit");
self.viewnum = focus.call("doc:add-view", self) - 1
self.point = None
self.map = []
if not self.pipe:
return False
self.call("doc:set:doc-status", "Running");
- self.call("doc:Notify:doc:status-changed")
+ self.call("doc:notify:doc:status-changed")
fd = self.pipe.stdout.fileno()
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
self.pipe = None
self.call("doc:replace", "\nProcess Finished\n");
self.call("doc:set:doc-status", "Complete")
- self.call("doc:Notify:doc:status-changed")
+ self.call("doc:notify:doc:status-changed")
return edlib.Efalse
self.call("doc:replace", r);
self.do_parse()
self.call("doc:step", m, 1, 1)
fname = self.call("doc:get-str", m, e, ret="str")
if self.first_match and self['make-follow'] == 'no':
- self.call("doc:Notify:make-set-match", m)
+ self.call("doc:notify:make-set-match", m)
self.first_match = False
if self.record_line(fname, lineno, m, is_note):
# new file - stop here
p = self.point
if p:
p["render:make-line"] = "no"
- self.call("doc:Notify:doc:Replace", p, p)
+ self.call("doc:notify:doc:replaced", p, p)
t = p.prev()
while t and t['has_note'] == 'yes':
t['render:first_err'] = None
- self.call("doc:Notify:doc:Replace", t, t)
+ self.call("doc:notify:doc:replaced", t, t)
t = t.prev()
while True:
if p:
break
self.point = p
p["render:make-line"] = "yes"
- self.call("doc:Notify:doc:Replace", p, p)
+ self.call("doc:notify:doc:replaced", p, p)
t = p.prev()
while t and t['has_note'] == 'yes':
t['render:first_err'] = 'yes'
- self.call("doc:Notify:doc:Replace", t, t)
+ self.call("doc:notify:doc:replaced", t, t)
t = t.prev()
self.note_ok = False
return self.map[int(p['ref'])]
docpane = par.call("OtherPane", ret='focus')
if docpane:
self.call("doc:attach-view", docpane)
- self.call("doc:Notify:make-set-match", self.point)
+ self.call("doc:notify:make-set-match", self.point)
return 1
def handle_revisit(self, key, mark, **a):
- "handle:Notify:doc:make-revisit"
+ "handle:doc:make-revisit"
self.do_parse()
p = self.call("doc:vmark-get", self.viewnum, mark, 3, ret='mark2')
if self.point:
self.point["render:make-line"] = "no"
- self.call("doc:Notify:doc:Replace", self.point, self.point)
+ self.call("doc:notify:doc:replaced", self.point, self.point)
t = p.prev()
while t and t['has_note'] == 'yes':
t['render:first_err'] = None
- self.call("doc:Notify:doc:Replace", t, t)
+ self.call("doc:notify:doc:replaced", t, t)
t = t.prev()
if p:
self.point = p.prev()
# jump to a given match, and similar
def __init__(self, focus):
edlib.Pane.__init__(self, focus)
- self.call("doc:Request:Notify:doc:Replace")
- self.call("doc:Request:Notify:make-set-match")
+ self.call("doc:request:doc:replaced")
+ self.call("doc:request:make-set-match")
def handle_set_match(self, key, mark, **a):
- "handle:Notify:make-set-match"
+ "handle:make-set-match"
self.call("Move-to", mark)
return 1
def handle_enter(self, key, focus, mark, **a):
"handle:Enter"
- focus.call("doc:Notify:doc:make-revisit", mark)
+ focus.call("doc:notify:doc:make-revisit", mark)
next_match("interactive-cmd-next-match", focus,
edlib.NO_NUMERIC, "OtherPane")
return 1
def handle_replace(self, key, mark, mark2, **a):
- "handle:Notify:doc:Replace"
+ "handle:doc:replaced"
if not mark or not mark2:
return 1
if self["make-follow"] == "no":
else:
self.sock.send("No Display!")
return 1
- if msg[:28] == "doc:Request:Notify:doc:done:":
+ if msg[:28] == "doc:Request:doc:done:":
path = msg[28:]
d = editor.call("doc:open", -1, path, ret="focus")
if not d:
self.sock.send("FAIL")
return 1
- self.add_notify(d, "Notify:doc:done")
+ self.add_notify(d, "doc:done")
if self.term:
self.term.call("Display:set-noclose",
"Cannot close display until document done - use 'C-x #'")
return 0
def handle_done(self, key, str, **a):
- "handle:Notify:doc:done"
+ "handle:doc:done"
if str != "test":
if self.term:
self.term.call("Window:set-noclose")
if ret != "OK":
print "Cannot open: ", ret
sys.exit(1)
- s.send("doc:Request:Notify:doc:done:"+file)
+ s.send("doc:request:doc:done:"+file)
else:
s.send("Request:Notify:Close")
ret = s.recv(100)
ServerPane(new)
def server_done(key, focus, **a):
- ret = focus.call("doc: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("doc: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")
choice = []
def chose(choice, a):
focus = a['focus']
- if focus.notify("Notify:doc:done", "test") > 0:
+ if focus.notify("doc:done", "test") > 0:
choice.append(focus)
return 1
return 0
self.timer_set = True
self.call("event:timer", 5*60*1000, self.tick)
self.searches.load(False)
- self.notify("Notify:doc:Replace")
+ self.notify("doc:replaced")
self.updating = "counts"
if not self.searches.update(self, self.updated):
self.update_next()
def updated(self, key, **a):
if not self.searches.updated():
self.update_next()
- self.notify("Notify:doc:Replace")
+ self.notify("doc:replaced")
return edlib.Efalse
def update_next(self):
self['background'] = 'color:#A0FFFF'
self['line-format'] = '<%fmt>%count %+name</>'
self.call("notmuch:set_list_pane")
- self.call("doc:Request:Notify:doc:Replace")
+ self.call("doc:request:doc:replaced")
self.selected = None
def handle_clone(self, key, focus, **a):
return 1
def handle_notify_replace(self, key, **a):
- "handle:Notify:doc:Replace"
+ "handle:doc:replaced"
self.damaged(edlib.DAMAGED_CONTENT|edlib.DAMAGED_VIEW)
return 0
m.pos = (self.new[0], None)
m = m.next_any()
self.threadids = self.new + self.old
- self.notify("Notify:doc:Replace")
+ self.notify("doc:replaced")
if found < 100 and self.age == None:
# must have found them all
self.call("doc:notmuch:query-updated")
t = self.threads[str]
s = self.maindoc.call("doc:notmuch:bythread:tags", str, ret='str')
t['tags'] = s.split(",")
- self.notify("Notify:doc:Replace")
+ self.notify("doc:replaced")
return 1
def handle_notify_close(self, **a):
t = j["tags"]
if "unread" in t:
t.remove("unread")
- self.notify("Notify:doc:Replace")
+ self.notify("doc:replaced")
# Pass this down to database document.
self.maindoc.call(key, str, str2)
return 0
self.thread_start = None
self.thread_end = None
self.thread_matched = None
- self.call("doc:Request:Notify:doc:Replace")
+ self.call("doc:request:doc:replaced")
def handle_clone(self, key, focus, **a):
"handle:Clone"
return 1
def handle_notify_replace(self, key, **a):
- "handle:Notify:doc:Replace"
+ "handle:doc:replaced"
self.damaged(edlib.DAMAGED_CONTENT)
return 1
return 1
def handle_notify_replace(self, key, mark, **a):
- "handle:Notify:doc:Replace"
+ "handle:doc:replaced"
# A change has happened at 'mark'. The following page might not
# be valid, and the previous may not be valid or have next-valid.
# If no previous, self.first_valid may not be.
return 1
def handle_recentre(self, key, focus, mark, num, comm2, **a):
- "handle:Notify:doc:Recentre"
+ "handle:doc:Recentre"
m2 = edlib.Mark(self)
m2.to_mark(mark)
if num == 2:
"handle:Display:refresh"
# Refresh causes presentation page to recenter
# page-down just moves down to start of next page.
- focus.call("doc: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("doc:Notify:doc:Recentre", m2, 2,
+ if focus.call("doc:notify:doc:Recentre", m2, 2,
lambda key, **a: mark.to_mark(a['mark'])) > 0:
return 1
if num < 0 and mark:
m2 = mark.dup()
- if focus.call("doc:Notify:doc:Recentre", m2, 3,
+ if focus.call("doc:notify:doc:Recentre", m2, 3,
lambda key, **a: mark.to_mark(a['mark'])) > 0:
return 1
return 0
p['background'] = 'color:yellow'
p['hide-cursor'] = 'yes'
- p.call("doc:Request:Notify:doc:Replace")
- p.call("doc:Request:Notify:doc:Recentre")
+ p.call("doc:request:doc:replaced")
+ p.call("doc:request:doc:Recentre")
comm2("callback", p)
return 1
key_add(he_map, "Close", &render_hex_close);
key_add(he_map, "Clone", &render_hex_clone);
- key_add(he_map, "Notify:doc:Replace", &render_hex_notify_replace);
+ key_add(he_map, "doc:replaced", &render_hex_notify_replace);
}
static struct pane *do_render_hex_attach(struct pane *parent safe)
render_hex_register_map();
p = pane_register(parent, 0, &render_hex_handle.c, he);
- call("doc:Request:Notify:doc:Replace", p);
+ call("doc:request:doc:replaced", 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;
key_add(rl_map, "Refresh:view", &render_lines_refresh_view);
key_add(rl_map, "Notify:clip", &render_lines_clip);
- key_add(rl_map, "Notify:doc:Replace", &render_lines_notify_replace);
+ key_add(rl_map, "doc:replaced", &render_lines_notify_replace);
/* view:changed is sent to a tile when the display might need
* to change, even though the doc may not have*/
key_add(rl_map, "view:changed", &render_lines_notify_replace);
p = call_ret(pane, "attach-renderline", p);
p = pane_register(p, 0, &render_lines_handle.c, rl);
rl->typenum = home_call(ci->focus, "doc:add-view", p) - 1;
- call("doc:Request:Notify:doc:Replace", p);
+ call("doc:request:doc:replaced", p);
return comm_call(ci->comm2, "callback:attach", p);
}