]> git.neil.brown.name Git - edlib.git/commitdiff
Don't require doc notification to start with Notify:
authorNeilBrown <neil@brown.name>
Fri, 22 Nov 2019 05:29:23 +0000 (16:29 +1100)
committerNeilBrown <neil@brown.name>
Fri, 22 Nov 2019 05:29:23 +0000 (16:29 +1100)
Sometimes it is useful for notifications to start Notify:,
but it shouldn't be forced.
So now doc notifications can be anything.
There are requested with "doc:request:NOTIFICATION-NAME"
and generated with "doc:notify:NOTIFICATION-NAME"

Signed-off-by: NeilBrown <neil@brown.name>
21 files changed:
DOC/Calls
core-doc.c
doc-dir.c
doc-docs.c
doc-email.c
doc-multipart.c
doc-rendering.c
doc-text.c
emacs-search.c
lib-history.c
lib-linecount.c
lib-tile.c
lib-view.c
mode-emacs.c
python/lib-abbrev.py
python/lib-make.py
python/lib-server.py
python/module-notmuch.py
python/render-present.py
render-hex.c
render-lines.c

index 5bc9039f5424603dc4a920e85b7b28462168090b..3f665d6341f11f8b80b40d777c6dd55ff2461f30 100644 (file)
--- a/DOC/Calls
+++ b/DOC/Calls
@@ -15,3 +15,14 @@ If only one mark is given, then the change is small and either starts
 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.
index 42139baac4a615d7ac5deec418a9d4aaec1a7e1c..4ea38cb24eac3ad48abc18973e79d43e2fc8943a 100644 (file)
@@ -477,7 +477,7 @@ DEF_CMD(doc_set)
        }
        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)
@@ -534,20 +534,20 @@ DEF_CMD(doc_set_name)
                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;
@@ -646,7 +646,7 @@ DEF_CMD(doc_delayed_close)
        /* 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;
@@ -1040,7 +1040,7 @@ DEF_CMD(doc_attach_view)
                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);
@@ -1102,7 +1102,7 @@ static void init_doc_cmds(void)
        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);
@@ -1129,9 +1129,9 @@ static void init_doc_cmds(void)
        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);
 }
 
@@ -1144,15 +1144,15 @@ static void do_doc_assign(struct pane *p safe, struct pane *doc safe)
        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)
index 94e1a340234dfec50a2236762d332a88294f94a4..dd19621a3751761c463e6670a399dcba4d2a1bc3 100644 (file)
--- a/doc-dir.c
+++ b/doc-dir.c
@@ -192,9 +192,9 @@ DEF_CMD(dir_load_file)
                        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 &&
@@ -206,9 +206,9 @@ DEF_CMD(dir_load_file)
                        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 */) {
@@ -235,7 +235,7 @@ DEF_CMD(dir_load_file)
        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) {
@@ -768,7 +768,7 @@ void edlib_init(struct pane *ed safe)
        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);
index 2b19546fb08d9e77e04a6c09c52ce028bcfb10cc..836e65327d4c2684937f76bc93bf49216fa6758d 100644 (file)
@@ -10,9 +10,9 @@
  * 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
@@ -79,7 +79,7 @@ static void docs_demark(struct docs *doc safe, struct pane *p safe)
                                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);
                }
 }
 
@@ -102,7 +102,7 @@ static void docs_enmark(struct docs *doc safe, struct pane *p safe)
             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);
                }
 }
 
@@ -429,8 +429,8 @@ DEF_CMD(docs_callback)
                        /* 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);
@@ -450,7 +450,7 @@ DEF_CMD(doc_damage)
                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);
@@ -686,7 +686,7 @@ static int docs_bury(struct pane *focus safe)
        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);
@@ -826,10 +826,9 @@ DEF_CMD(docs_attach)
                        //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.
                         */
@@ -891,12 +890,12 @@ static void docs_init_map(void)
 
        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);
index b340c21781b10e769912c402a49fae5cef1b903a..e0388a7628fcd00a8a1379a47b7b2038a3383383 100644 (file)
@@ -13,7 +13,7 @@
  *  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
  */
index 8b33ece1f1a9b383bb7e25e8f37c8259b14ed845..d973b1a17a0d36b977dbcf443763c0b357ee49e2 100644 (file)
@@ -488,7 +488,7 @@ DEF_CMD(mp_add)
                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;
 }
@@ -551,7 +551,7 @@ static void mp_init_map(void)
        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);
index 65b36ef720e9c9f5b67117b8dc77af1125b29527..654e0f682874598266a0b97120447bcb4c80c2cf 100644 (file)
@@ -390,7 +390,7 @@ DEF_CMD(dr_notify_replace)
                m->mdata = NULL;
                m = vmark_next(m);
        }
-       pane_notify("Notify:doc:Replace", ci->home);
+       pane_notify("doc:replaced", ci->home);
        return 1;
 }
 
@@ -553,10 +553,10 @@ static void dr_init_map(void)
        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);
@@ -578,10 +578,10 @@ DEF_CMD(attach_dr)
        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;
 
index 655789fbc612fb9a560107d3997ea6bdd6f912a0..ae975ea1d7f8b95131b5feab53e3adbaa92a8afc 100644 (file)
@@ -252,7 +252,7 @@ static bool check_file_changed(struct text *t safe)
            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;
@@ -351,8 +351,8 @@ DEF_CMD(text_load_file)
        }
        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;
@@ -570,7 +570,7 @@ DEF_CMD(text_save_file)
        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;
@@ -1134,7 +1134,7 @@ static bool check_readonly(const struct cmd_info *ci safe)
        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)
@@ -1277,7 +1277,7 @@ DEF_CMD(text_reundo)
                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);
 
@@ -1288,7 +1288,7 @@ DEF_CMD(text_reundo)
        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)
@@ -2019,8 +2019,8 @@ DEF_CMD(text_replace)
        }
        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);
@@ -2135,7 +2135,7 @@ DEF_CMD(text_set_attr)
                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;
 }
@@ -2155,7 +2155,7 @@ DEF_CMD(text_modified)
        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;
 }
 
@@ -2247,7 +2247,7 @@ void edlib_init(struct pane *ed safe)
        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);
index f5f19abbd8515932a749e915ddfa527511ad4896..21c20224315025e571bb41c57c2d92f7eddae819 100644 (file)
@@ -392,7 +392,7 @@ DEF_CMD(search_toggle_ci)
        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 ");
@@ -409,7 +409,7 @@ static void emacs_search_init_map(void)
        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);
@@ -447,7 +447,7 @@ DEF_CMD(emacs_search)
 
        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);
        }
index 2ea496dfd6d3f3a1a653bf8e11b76b6f39ea34e9..4697e7448baf31f6073904b943cd512e88a4095a 100644 (file)
@@ -167,7 +167,7 @@ DEF_CMD(history_attach)
        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);
 }
 
@@ -204,7 +204,7 @@ void edlib_init(struct pane *ed safe)
        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);
 }
index 54230b60a215697f031b73c2bb1d8f20f36682e5..d3a24e5377e61382d51a4e7ff523a2b0720c2af2 100644 (file)
@@ -300,7 +300,7 @@ DEF_CMD(linecount_clip)
 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;
@@ -308,22 +308,22 @@ DEF_CMD(count_lines)
                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;
 }
@@ -337,8 +337,8 @@ void edlib_init(struct pane *ed safe)
 
        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);
 }
index 3f69a0066a16010eea89287fa12cf28edeaef8ea..c630b0c3af14a0059da8a057e3082778772e31ed 100644 (file)
@@ -813,7 +813,7 @@ DEF_CMD(tile_window_bury)
        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)
index 7ff6428564cffe5058ae81ff659eee069611e53d..be4e977cdc890feb0a9d00c63af70a291cc3fc29 100644 (file)
@@ -382,7 +382,7 @@ static struct pane *safe do_view_attach(struct pane *par, int border)
        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;
 }
@@ -521,7 +521,7 @@ void edlib_init(struct pane *ed safe)
        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);
 
index 82db0ed51977902670b7a2faf2e37ee4358fdd6f..48248094dc9ddb8592c4a0ce4632a0629777f0ca 100644 (file)
@@ -1006,7 +1006,7 @@ REDEF_CMD(emacs_file_complete)
        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)) {
index 2dc608cdec1db2980b2ce89df0504e49922e6808..6bf4a003afcf9200eb58a710301c68764852434e 100644 (file)
@@ -18,8 +18,8 @@ class AbbrevPane(edlib.Pane):
     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()
@@ -194,7 +194,7 @@ class AbbrevPane(edlib.Pane):
         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)
index f0ea41335df82de689f72488291fd2db341022bd..ac1ed0a135faf4eebc2e0ecd54771ccb1b5a1433 100644 (file)
@@ -23,7 +23,7 @@ class MakePane(edlib.Pane):
     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 = []
@@ -44,7 +44,7 @@ class MakePane(edlib.Pane):
         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)
@@ -63,7 +63,7 @@ class MakePane(edlib.Pane):
             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()
@@ -114,7 +114,7 @@ class MakePane(edlib.Pane):
             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
@@ -203,11 +203,11 @@ class MakePane(edlib.Pane):
         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:
@@ -220,11 +220,11 @@ class MakePane(edlib.Pane):
                 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'])]
@@ -308,20 +308,20 @@ class MakePane(edlib.Pane):
             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()
@@ -383,23 +383,23 @@ class MakeViewerPane(edlib.Pane):
     # 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":
index 6c7da51a9221f3441ea3d6774b4ab0c624899769..7e5f7d1372b77f9cfaba8d7b1cd432b4ca45dbcb 100755 (executable)
@@ -69,13 +69,13 @@ try:
                     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 #'")
@@ -125,7 +125,7 @@ try:
             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")
@@ -191,7 +191,7 @@ if is_client:
         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)
@@ -214,7 +214,7 @@ else:
         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"]
@@ -222,7 +222,7 @@ else:
             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")
@@ -231,7 +231,7 @@ else:
             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
index 42080409efa610a52dd600d85b252adc9d78bb3b..4fe39a49f1b9b133c06289896e8fd3cde7f4e480 100644 (file)
@@ -340,7 +340,7 @@ class notmuch_main(edlib.Doc):
             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()
@@ -513,7 +513,7 @@ class notmuch_main(edlib.Doc):
     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):
@@ -817,7 +817,7 @@ class notmuch_main_view(edlib.Pane):
         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):
@@ -827,7 +827,7 @@ class notmuch_main_view(edlib.Pane):
         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
 
@@ -933,7 +933,7 @@ class notmuch_list(edlib.Doc):
                     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")
@@ -1103,7 +1103,7 @@ class notmuch_list(edlib.Doc):
             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):
@@ -1325,7 +1325,7 @@ class notmuch_list(edlib.Doc):
             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
@@ -1343,7 +1343,7 @@ class notmuch_query_view(edlib.Pane):
         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"
@@ -1352,7 +1352,7 @@ class notmuch_query_view(edlib.Pane):
         return 1
 
     def handle_notify_replace(self, key, **a):
-        "handle:Notify:doc:Replace"
+        "handle:doc:replaced"
         self.damaged(edlib.DAMAGED_CONTENT)
         return 1
 
index b1e2ab0252c9bb9b3e0b7a36e27fd141bd78efb0..c49eb2e9da8778ba0dfbb3ecc9d099f37f362f27 100644 (file)
@@ -582,7 +582,7 @@ class PresenterPane(edlib.Pane):
         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.
@@ -617,7 +617,7 @@ class PresenterPane(edlib.Pane):
         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:
@@ -707,19 +707,19 @@ class MarkdownPane(edlib.Pane):
         "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
@@ -730,8 +730,8 @@ def present_attach(key, focus, comm2, **a):
     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
 
index d87f96dc50b4a391faface87557e043c2a652441..67084cafca3aeb08bf7fef7d66d72b80d1a63846 100644 (file)
@@ -208,7 +208,7 @@ static void render_hex_register_map(void)
 
        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)
@@ -221,7 +221,7 @@ 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;
index 160ee66b0d99ecbf33bee3d26382dc325f7d5ae1..f91aac1d053ec7096123c1fcf26e50a01a702718 100644 (file)
@@ -1900,7 +1900,7 @@ static void render_lines_register_map(void)
        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);
@@ -1922,7 +1922,7 @@ REDEF_CMD(render_lines_attach)
                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);
 }