From 93ced79f37fab2cc6843d9c8f097f577b69aad9a Mon Sep 17 00:00:00 2001 From: Justin Frank Date: Sat, 16 Mar 2019 01:09:42 -0700 Subject: [PATCH] Updated the changelog, commands, and hooks docs to be clearer --- doc/pages/changelog.asciidoc | 4 ++-- doc/pages/commands.asciidoc | 12 +++++++++--- doc/pages/hooks.asciidoc | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc index 206a3c5a..61b2af89 100644 --- a/doc/pages/changelog.asciidoc +++ b/doc/pages/changelog.asciidoc @@ -19,8 +19,8 @@ released versions. `requires-module` commands that allows for lazily loading language support files with dependency resolution. -* Added a new hook `ModuleLoad` which is run when a module is loaded, as - now options needed by modules aren't defined until the module is loaded. +* Added a new hook `ModuleLoad` which is run when a module is loaded, + allowing for module specific configuration. == Kakoune 2019.01.20 diff --git a/doc/pages/commands.asciidoc b/doc/pages/commands.asciidoc index 9f5e238e..c9c84b96 100644 --- a/doc/pages/commands.asciidoc +++ b/doc/pages/commands.asciidoc @@ -315,11 +315,17 @@ but not really useful in that context. == Module commands *provide-module* [] :: - declares a new module that is provided by the given commands. The commands - passed into the module are guaranteed to be run only once. + declares a module *name* that is defined by *commands*. *commands* will be + evaluated as if by source the first time *require-module * is run. + +*-override*::: + allow the module to replace and existing one with the same name *require-module* :: - guarantees the module is loaded before continuing command execution + guarantees the commands associated with *name* have been evaluated before + continuing command execution. Fails if *name* has not been defined by a + *provide-module* command. Does nothing if the associated commands have + already been evaluated. == Multiple commands diff --git a/doc/pages/hooks.asciidoc b/doc/pages/hooks.asciidoc index d91781fb..2615bc52 100644 --- a/doc/pages/hooks.asciidoc +++ b/doc/pages/hooks.asciidoc @@ -181,7 +181,7 @@ name. Hooks with no description will always use an empty string. Triggered whenever a key is pressed by the user *ModuleLoad* `module`:: - Triggered when a module is loaded + Triggered when a module is evaluated by the first `require-module` call Note that some hooks will not consider underlying scopes depending on what context they are bound to be run into, e.g. the `BufWritePost` hook is a buffer