pub struct ScanViewMode;Expand description
agenda-view-mode — the minor the provider activates on the agenda view.
The ProjectSearchMode shape (org-mode.md §4.2): multibuffer-mode is
the view’s major, and the provider contributes a minor carrying what is
specific to this view.
§Why this is native and not the plugin’s org-agenda-mode
The design fragment gave gr to org-agenda-mode, which the plugin owns.
It cannot have it, for a reason that is structural rather than a matter of
taste: refreshing the agenda means re-running the HOST’s walk, which is
AppEffect::OpenProviderView — and that effect’s plugin surface is
deliberately withheld (boundary_app_effect.rs), pending the
capability model for which providers a plugin may trigger. A plugin
gr could bind the chord and not do the work.
It is also the better split on merit. Refreshing a host-built view is
host machinery: the second scanned-excerpt-source plugin — the markdown TODO
scanner the whole extensions() design exists for — inherits gr here,
where under the fragment’s version every agenda plugin would re-derive it.
That is the copied-keymap failure the minor-mode rule forbids, one layer
up. What stays the plugin’s is what is genuinely org: acting on a TODO
state from the agenda, through org-agenda-mode’s own chords and its own
handler bodies. Both modes are active on the view at once; neither is a
half-migration.
Implementations§
Source§impl ScanViewMode
impl ScanViewMode
Trait Implementations§
Source§impl Mode for ScanViewMode
impl Mode for ScanViewMode
Source§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
Manual: the provider activates it on the view it just built. An
activation policy could not express “the buffer this provider made”,
and a policy keyed on BufferKind::Multibuffer would attach it to
every search and diff view too.
Source§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
Returning Some is the whole of the gr wiring: it pulls
refreshable-view-mode in through the implies cascade, and that mode
owns the chord. One line, no second thing to remember — which matters,
because forgetting the second thing kills the chord silently.
Source§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
OA.4b: this view folds by blocks, so <Tab> / <S-Tab> come from the
shared foldable-view-mode. Nothing special to do on a block, so it
names the generic body.
Source§fn keymap(&self) -> Keymap
fn keymap(&self) -> Keymap
OA.16: cr toggles the clock report.
The chord lives here and not on the mode it switches, which is the
one place the “modes own their full surface” rule cannot be read
literally: a keymap layer is gated to buffers where its mode is
active, so a cr on scan-view-clockreport-mode could turn the report
off and never on. The switch belongs to the surface that offers it —
this view — and everything the report does (registering its rows,
its element vocabulary, tearing both down) stays with the mode. Same
split as refreshable-view-mode, one layer over.
cr rather than emacs’ bare R: R is vim’s replace-mode, and while
a read-only view makes it inert today, taking a grammar letter for a
display toggle is a debt the moment any scan view becomes editable.
c is free here — the change operator has nothing to change — and v
is already the agenda’s span prefix, so a two-key form is the shape
this view’s chords already have.
Source§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
The mode that declares the target also supplies the body. Leaving the handler to the host would be the half-migration the standing rule forbids.
Source§fn kind(&self) -> ModeKind
fn kind(&self) -> ModeKind
activate_major on a minor, or vice versa, is
[ModeActivationError::WrongKind]).Source§fn on_activate(&self, _ctx: ModeContext) -> LifecycleFuture<'_, ()>
fn on_activate(&self, _ctx: ModeContext) -> LifecycleFuture<'_, ()>
Guard
carrying every resource the mode allocated. The
dispatcher stashes the Guard until deactivation, at which
point dropping it performs cleanup via the Guard’s Drop
impl. Read more§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
BufferKind] this mode is the default
major for (H.2, 2026-05-31). ModeRegistry::register
indexes this so
ModeRegistry::find_major_for_kind can
dispatch buffer-creation events to the right major without
host-side match BufferKind { ... } blocks. Read more§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
Lang::name() —
"rust", "org") (OM.1). The peer of
target_buffer_kind for the
dispatch path [BufferKind::Document] takes: language
detection rather than kind dispatch. Read more§fn options(&self) -> OptionOverrideSet
fn options(&self) -> OptionOverrideSet
lattice_config::overrides! { lattice_config::Wrap = true, … }.§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
§fn gutter_decorations(&self, _ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, _ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
DecorationCtx]
carrying relevant render-state snapshots (diff sign map, LSP
diagnostics arc). Returns per-line GutterDecoration values;
the renderer partitions them by variant into the appropriate
gutter column. Default: empty (no contribution).§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
lsp-completion-mode,
snippet-completion-mode, buffer-words-mode,
tree-sitter-completion-mode, path-completion-mode,
plugin sources) override.§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
ModeActivationError::MissingCapability], never silent
skip.§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
§fn implies(&self) -> &[ModeId]
fn implies(&self) -> &[ModeId]
relative-line-numbers-mode ⇒ line-numbers-mode, and by
read-only majors ⇒ read-only-mode. Read more§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Some(canonical_name) ⇒ a host-driven cascade keeps the
mode’s active state and the option’s value in sync.§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
ModeId]; the host registers a
runner function under that id at boot, and
Editor::run_invocation looks it up by walking the
active modes on the active pane’s buffer (minors first,
then major) before falling back to the central grammar
Action gate. Read more§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
None (the default) for a fully read-only / fully writable buffer
(AU‑3). Read moreAuto Trait Implementations§
impl Freeze for ScanViewMode
impl RefUnwindSafe for ScanViewMode
impl Send for ScanViewMode
impl Sync for ScanViewMode
impl Unpin for ScanViewMode
impl UnsafeUnpin for ScanViewMode
impl UnwindSafe for ScanViewMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<M> DynMode for Mwhere
M: Mode,
impl<M> DynMode for Mwhere
M: Mode,
§fn target_buffer_kind(&self) -> Option<BufferKind>
fn target_buffer_kind(&self) -> Option<BufferKind>
Mode::target_buffer_kind].§fn target_language(&self) -> Option<&str>
fn target_language(&self) -> Option<&str>
Mode::target_language].§fn decorations(&self) -> Vec<DecorationProvider>
fn decorations(&self) -> Vec<DecorationProvider>
Mode::decorations].§fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
fn gutter_decorations(&self, ctx: &DecorationCtx<'_>) -> Vec<GutterDecoration>
Mode::gutter_decorations].§fn completion_sources(&self) -> Vec<CompletionSourceContribution>
fn completion_sources(&self) -> Vec<CompletionSourceContribution>
Mode::completion_sources].§fn action_handlers(&self) -> Vec<ActionHandlerContribution>
fn action_handlers(&self) -> Vec<ActionHandlerContribution>
Mode::action_handlers].§fn required_capabilities(&self) -> CapabilitySet
fn required_capabilities(&self) -> CapabilitySet
Mode::required_capabilities].§fn conflicts_with(&self) -> &[ModeId]
fn conflicts_with(&self) -> &[ModeId]
Mode::conflicts_with].§fn presents_extensions(&self) -> &[&'static str]
fn presents_extensions(&self) -> &[&'static str]
Mode::presents_extensions].§fn mirrors_option(&self) -> Option<&'static str>
fn mirrors_option(&self) -> Option<&'static str>
Mode::mirrors_option].§fn invocation_runner(&self) -> Option<ModeId>
fn invocation_runner(&self) -> Option<ModeId>
Mode::invocation_runner].§fn refresh_action(&self) -> Option<&'static str>
fn refresh_action(&self) -> Option<&'static str>
Mode::refresh_action].§fn fold_toggle_action(&self) -> Option<&'static str>
fn fold_toggle_action(&self) -> Option<&'static str>
Mode::fold_toggle_action].§fn refresh_on_open(&self) -> bool
fn refresh_on_open(&self) -> bool
Mode::refresh_on_open].§fn activation_policy(&self) -> ActivationPolicy
fn activation_policy(&self) -> ActivationPolicy
Mode::activation_policy].§fn editable_tail(&self) -> Option<EditableTail>
fn editable_tail(&self) -> Option<EditableTail>
Mode::editable_tail].§fn on_activate_dyn<'a>(
&'a self,
ctx: ModeContext,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>, ModeActivationError>> + Send + 'a>>
fn on_activate_dyn<'a>( &'a self, ctx: ModeContext, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Any + Send>, ModeActivationError>> + Send + 'a>>
Box<dyn Any + Send>.
The dispatcher stashes this box keyed by
(BufferId, ModeId); deactivation drops it.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more