From: NeilBrown Date: Fri, 1 Sep 2023 02:47:22 +0000 (+1000) Subject: Rename doc:attach-helper to doc:get-doc X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=d4a32375c4ffa9975f41847f219c39ef96cc74b0;p=edlib.git Rename doc:attach-helper to doc:get-doc 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 --- diff --git a/DOC/Developer/03-documents.md b/DOC/Developer/03-documents.md index 1d3cf81e..5c9b9f6b 100644 --- a/DOC/Developer/03-documents.md +++ b/DOC/Developer/03-documents.md @@ -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); diff --git a/core-doc.c b/core-doc.c index ace6c942..a7b902c5 100644 --- a/core-doc.c +++ b/core-doc.c @@ -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); diff --git a/lib-aspell.c b/lib-aspell.c index 8fb4f4b0..38b79937 100644 --- a/lib-aspell.c +++ b/lib-aspell.c @@ -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-")); } diff --git a/python/lib-autospell.py b/python/lib-autospell.py index 6bb5287b..f40d31a0 100644 --- a/python/lib-autospell.py +++ b/python/lib-autospell.py @@ -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