]> git.neil.brown.name Git - edlib.git/commitdiff
Rename doc:attach-helper to doc:get-doc
authorNeilBrown <neil@brown.name>
Fri, 1 Sep 2023 02:47:22 +0000 (12:47 +1000)
committerNeilBrown <neil@brown.name>
Fri, 1 Sep 2023 02:47:22 +0000 (12:47 +1000)
The behaviour of doc:attach-helper is to call the comm2 callback with
the doc as the ci->focus.
This can be used to attach a helper, but can be used for other things.
It really just gets the doc for the caller to act on.
So rename it.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/Developer/03-documents.md
core-doc.c
lib-aspell.c
python/lib-autospell.py

index 1d3cf81ebc69c883d3777fdd75a12cef6864f9c9..5c9b9f6b89ddaec444ef55d64238c5095b2759bd 100644 (file)
@@ -150,7 +150,7 @@ the objects to present
        key_add(doc_default_cmd, "doc:push-point", &doc_push_point);
        key_add(doc_default_cmd, "doc:pop-point", &doc_pop_point);
        key_add(doc_default_cmd, "doc:attach-view", &doc_attach_view);
-       key_add(doc_default_cmd, "doc:attach-helper", &doc_attach_helper);
+       key_add(doc_default_cmd, "doc:get-doc", &doc_attach_helper);
        key_add(doc_default_cmd, "Close", &doc_close_doc);
 
        key_add(doc_default_cmd, "doc:word", &doc_word);
index ace6c9423045f7c314f32ed4fae72b9d80ccf4da..a7b902c58d43c53609c111175e6c78875ac3c14d 100644 (file)
@@ -1277,7 +1277,7 @@ out:
        return 1;
 }
 
-DEF_CMD(doc_attach_helper)
+DEF_CMD(doc_get_doc)
 {
        if (!ci->comm2)
                return Enoarg;
@@ -1345,7 +1345,7 @@ static void init_doc_cmds(void)
        key_add(doc_default_cmd, "doc:push-point", &doc_push_point);
        key_add(doc_default_cmd, "doc:pop-point", &doc_pop_point);
        key_add(doc_default_cmd, "doc:attach-view", &doc_attach_view);
-       key_add(doc_default_cmd, "doc:attach-helper", &doc_attach_helper);
+       key_add(doc_default_cmd, "doc:get-doc", &doc_get_doc);
        key_add(doc_default_cmd, "Close", &doc_close_doc);
 
        key_add(doc_default_cmd, "doc:word", &doc_word);
index 8fb4f4b0d97855f8a632fb819f0e561476098f8f..38b79937e927289a7f4eea84fbbbcebca6e10180 100644 (file)
@@ -102,7 +102,7 @@ DEF_CMD(spell_check)
 
        if (rv != Efallthrough)
                return rv;
-       call_comm("doc:attach-helper", ci->focus, &aspell_attach_helper);
+       call_comm("doc:get-doc", ci->focus, &aspell_attach_helper);
        return call("doc:notify:aspell:check", ci->focus, 0, NULL, ci->str);
 }
 
@@ -136,7 +136,7 @@ DEF_CMD(spell_suggest)
 
        if (rv != Efallthrough)
                return rv;
-       call_comm("doc:attach-helper", ci->focus, &aspell_attach_helper);
+       call_comm("doc:get-doc", ci->focus, &aspell_attach_helper);
        return call_comm("doc:notify:aspell:suggest", ci->focus, ci->comm2,
                         0, NULL, ci->str);
 }
@@ -194,7 +194,7 @@ DEF_CMD(spell_add)
 
        if (rv != Efallthrough)
                return rv;
-       call_comm("doc:attach-helper", ci->focus, &aspell_attach_helper);
+       call_comm("doc:get-doc", ci->focus, &aspell_attach_helper);
        return call_comm("doc:notify:aspell:add-word", ci->focus, ci->comm2,
                         ci->num, NULL, ci->str);
 }
@@ -227,7 +227,7 @@ DEF_CMD(spell_dict)
                   ksuffix(ci, "interactive-cmd-dict-"));
        if (ret != Efallthrough)
                return ret;
-       call_comm("doc:attach-helper", ci->focus, &aspell_attach_helper);
+       call_comm("doc:get-doc", ci->focus, &aspell_attach_helper);
        return call("doc:notify:aspell:set-dict", ci->focus, 0, NULL,
                    ksuffix(ci, "interactive-cmd-dict-"));
 }
index 6bb5287bec92e228bd6f2d888d9d8d738fff61cc..f40d31a029eb00e76bdf90b18db8cc3c32c6d8f9 100644 (file)
@@ -299,7 +299,7 @@ class autospell_view(edlib.Pane):
             self.vend = mark2.dup()
             if (not self.helper_attached and
                 not self.call("doc:notify:spell:mark-checked")):
-                self.call("doc:attach-helper", autospell_attach_helper)
+                self.call("doc:get-doc", autospell_attach_helper)
                 self.helper_attached = True
             self.sched()
         return edlib.Efallthrough