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