summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-04-25 11:59:42 +0100
committerMaxime Coste <mawww@kakoune.org>2019-04-25 11:59:42 +0100
commit0cc89b2b9f3cdeff960bd55a865ee0f52fa98d25 (patch)
treebd4860272e271f215e4d9ba7d2049be9f44ac211 /doc
parent429eeb252c6e7ac8512c2bd98ed3b18c62d7f37b (diff)
parentf49644e8ee8b2450f28b82d74fcf823d81f2ae1c (diff)
Merge remote-tracking branch 'laelath/provides-requires'
Diffstat (limited to 'doc')
-rw-r--r--doc/pages/changelog.asciidoc9
-rw-r--r--doc/pages/commands.asciidoc16
-rw-r--r--doc/pages/hooks.asciidoc3
3 files changed, 27 insertions, 1 deletions
diff --git a/doc/pages/changelog.asciidoc b/doc/pages/changelog.asciidoc
index 707dac55..156e6472 100644
--- a/doc/pages/changelog.asciidoc
+++ b/doc/pages/changelog.asciidoc
@@ -24,13 +24,20 @@ released versions.
* `InsertCompletionSelect` hook has been removed as
`completions` commands now provides a similar feature.
+* Introduced a module system using the `provide-module` and
+ `require-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,
+ allowing for module specific configuration.
+
== Kakoune 2019.01.20
* `auto_complete` has been renamed to `autocomplete` for more
consistency.
* Start of a builtin key parser in the ncurses ui bypassing
- the ncurses one. Can be favored by setting the ui option
+ the ncurses one. Can be favored by setting the ui option
`ncurses_builtin_key_parser` to `true`.
* Right clicks extend the current selection, the control modifier allows
diff --git a/doc/pages/commands.asciidoc b/doc/pages/commands.asciidoc
index cc1b06af..ebaafaea 100644
--- a/doc/pages/commands.asciidoc
+++ b/doc/pages/commands.asciidoc
@@ -328,6 +328,22 @@ but not really useful in that context.
*debug* {info,buffers,options,memory,shared-strings,profile-hash-maps,faces,mappings}::
print some debug information in the *\*debug** buffer
+== Module commands
+
+*provide-module* [<switches>] <name> <commands>::
+ declares a module *name* that is defined by *commands*. *commands* will be
+ evaluated as if by source the first time *require-module <name>* is run.
+
+*-override*:::
+ allow the module to replace an existing one with the same name. Fails if
+ the module has already been evaluated.
+
+*require-module* <name>::
+ 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
Commands (c.f. previous sections) can be chained, by being separated either
diff --git a/doc/pages/hooks.asciidoc b/doc/pages/hooks.asciidoc
index 163b2fdd..ec45fe63 100644
--- a/doc/pages/hooks.asciidoc
+++ b/doc/pages/hooks.asciidoc
@@ -176,6 +176,9 @@ name. Hooks with no description will always use an empty string.
*RawKey* `key`::
Triggered whenever a key is pressed by the user
+*ModuleLoad* `module`::
+ 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
hook, and will not consider the `window` scope.