pub struct ReadOnly;Expand description
Whether the buffer is read-only (mutating operators
reject; :w still permits explicit writes if a path
exists). customizable = false because this is
mode-driven, not a user-typed config: major modes like
help-mode, file-tree-mode, and the LSP log modes
contribute ReadOnly = true via Mode::options() (per
mode-architecture.md §6.5.3 read-only-mode pattern).
Users who want to flip it on / off for a particular
buffer use :enable read-only-mode, not
:set read-only=true. That minor exists — it is
declared in lattice_mode::modes::display and registered
with the other foundation modes; the parenthetical here
used to read “when that minor mode lands in M.7” long
after it had, which is enough to send a reader off to
build a second one.
A provider whose buffer is read-only conditionally —
same kind, same major, editable or not depending on what
it is showing — activates that minor on the buffer via
ModeActivator::activate_minor_by_id and clears it with
deactivate_minor_by_id, rather than reaching for this
option directly.
Implementations§
Source§impl ReadOnly
impl ReadOnly
Sourcepub fn build_spec() -> Option<bool>
pub fn build_spec() -> Option<bool>
Build the runtime spec for this declaration.
Used by the registry’s self-registration boot
path; not generally called by hand. Direct
construction of Option<T> is the macro’s
internal-only path – consumer code uses
config.get_typed::<#name_ident>() to read
and config.set_typed::<#name_ident>(...) to
write.
Trait Implementations§
Source§impl HasGroup for ReadOnly
impl HasGroup for ReadOnly
Source§const GROUP_NAME: &'static str = <crate::Editor as ::lattice_config::OptionGroup>::NAME
const GROUP_NAME: &'static str = <crate::Editor as ::lattice_config::OptionGroup>::NAME
"editor", "lsp", …). The macro
pulls this from the group = SomeGroup; directive at the
declaration block’s head.Source§impl OptionDecl for ReadOnly
impl OptionDecl for ReadOnly
Source§const NAME: &'static str = ReadOnly
const NAME: &'static str = ReadOnly
:set <NAME>=…,
TOML keys, completion candidates, :describe-option.
Internal access is type-driven. The macro derives this
from the option’s identifier (with namespace prefix when
declared via mode_options!); manually-typed NAMEs are
not supported for built-in options.Source§const DOC: &'static str = ReadOnly
const DOC: &'static str = ReadOnly
:describe-option, the :customize
form’s per-row help, and :apropos results.Source§const CUSTOMIZABLE: bool = false
const CUSTOMIZABLE: bool = false
true (the default) ⇒ option
appears in :set autocomplete + the :customize group
view. false ⇒ plugin / engine-internal state, hidden
from user surfaces. Equivalent of emacs’s defvar vs
defcustom. (See mode-architecture.md §6.5.3.)Source§fn default_value() -> Self::Value
fn default_value() -> Self::Value
const) so non-const-constructible types like String
can be defaults.