Hello
During the last few days, mawww expressed his thoughts about future Kakoune development that I found interesting to share here.
…as registers are a bit transient and I imagine it would be useful to save a mark register into an option, that actually leads to something I’d like to explore later on, which is merging registers and options into a single concept
and on IRC:
I want to explore moving hooks to some kind of option, see if we can use options as a backend for hooks the same way emacs does, in which case it would become relatively trivial Yeah, and I would be happy to reduce the amount of separate concepts in Kakoune, especially as a lot of them converged to some list of strings (hooks and registers are basically that)
So the idea would be to reduce the number of concepts needed to grasp Kakoune and to merge registers
and hooks
with options
.
What could be the challenges of this fusion? A few initial raw ideas to bootstrap the discussion:
Scopes
- options : global, buffer, window, current
- hooks: global, buffer, window
- registers: not scoped
Some registers, like the letter ones could be forced to only be declared on the global scope. Meanwhile other register makes sense only on the buffer scope like %
for the buffer name.
Namespace
If %reg{a}
becomes %opt{a}
does it mean that 1 letter option name are now reserved for Kakoune internal only? And what about the %val{…}
expansion? Isn’t that just a readonly option in a way?
Benefits
-
Less surface area, increased orthogonality
-
A
RegisterChanged
hook has been asked for a long time: Add hook to notify that a register has been modified · Issue #859 · mawww/kakoune · GitHub If registers are just options, we could then listen toGlobalSetOption
instead.
How do you envision this merge? Pros and cons?