Skip to main content

Module source

Module source 

Source
Expand description

Provenance metadata (DESIGN.md §5.11).

Every registered / bound / set thing carries a SourceLocation. :describe-* formatters render it as a [[file:...]]-style link the user can follow to inspect or edit the source.

Forgery prevention is structural: there is no public function that takes a SourceLocation parameter and stores it. Built-in registrations capture the call site via #[track_caller]; static slices use declarative macros (keymap_entry!, …) that inject the location at each row’s site. Trusted subsystems (config loader, plugin host bridge, runtime dispatcher) reach the pub(crate) insert_* registry methods directly and construct sources from their own ground truth.

Structs§

SourceLocation
Where a registered command, binding or option came from: who put it there (SourceLayer) and where to look (SourceKind).

Enums§

SourceKind
Where to look. Most cases are a real file with a line; a few are synthetic origins that the link follower routes to a different kind of buffer (command-history, macro buffer, transitive dot-repeat).
SourceLayer
Why this thing exists – editor binary, user config, plugin, etc. Renders as a one-word label next to the [[link]] in help output.