Closed j-shilling closed 2 years ago
This is huge @j-shilling , probably the #1 feature missing from Symex. Thank you for being a hero and taking this on! I will take a closer look at this soon 🤸 💃
Initial impressions:
I tried swallow and shift-right and they both work! Exciting. However, it looks like motions (e.g. symex-go-forward
, symex-go-backward
) are also treated as repeatable commands, even though they aren't listed in symex--evil-repeatable-commands
. As a result, in order to repeat them after moving, we need to do .
followed by C-.
until it pops the motion off the most recent and finds the swallow
/shift
command.
Are you seeing this as well?
Initial impressions: I tried swallow and shift-right and they both work! Exciting. However, it looks like motions (e.g.
symex-go-forward
,symex-go-backward
) are also treated as repeatable commands, even though they aren't listed insymex--evil-repeatable-commands
. As a result, in order to repeat them after moving, we need to do.
followed byC-.
until it pops the motion off the most recent and finds theswallow
/shift
command.Are you seeing this as well?
Ah, yep, that was happening for me as well, but I've found the problem and it should have been resolved by 54ac804.
Nice work on those changes 👌
I noticed that if the command exits with an error, then it is left in Normal state instead of Symex state. E.g.:
|(a b c)
(a b c)
Hitting z
(swallow) works the first time. Then hit .
when the expression is |a b c
and it will raise an error, and this leaves it in Normal state.
Wrapping this line with error handling would probably be sufficient here. Something like this:
(unwind-protect
(apply orig-fun args)
(when symex-state-p
(evil-symex-state)))
@j-shilling This is looking great so far. I noticed that there are a few commands missing from symex--evil-repeatable-commands
:
symex-change
symex-change-remaining
symex-change-delimiter
symex-open-line-after
symex-open-line-before
symex-collapse
symex-unfurl
symex-collapse-remaining
symex-unfurl-remaining
symex-tidy-remaining
symex-tidy-proper
symex-append-after
symex-insert-at-end
symex-insert-at-beginning
symex-insert-before
symex-wrap-and-append
I'll continue using it for a few more days to test it further.
@j-shilling This is looking great so far. I noticed that there are a few commands missing from
symex--evil-repeatable-commands
:symex-change symex-change-remaining symex-change-delimiter symex-open-line-after symex-open-line-before symex-collapse symex-unfurl symex-collapse-remaining symex-unfurl-remaining symex-tidy-remaining symex-tidy-proper symex-append-after symex-insert-at-end symex-insert-at-beginning symex-insert-before symex-wrap-and-append
I'll continue using it for a few more days to test it further.
This might actually take some more experimentation. I'm not super confident what will happen with commands that change states--but I'll fiddle around with it and see.
Thank you for your contribution @j-shilling . Much appreciated 🙏
Summary of Changes
Integrates symex-evil.el with evil-repeat.el by advising key
evil-repeat
related functions. Mainly, this sets up behavior to:pre-
andpost-command-hook
2.:repeat
property for a bunch of symex commands tot
.Public Domain Dedication
(Why: The freely released, copyright-free work in this repository represents an investment in a better way of doing things called attribution-based economics. Attribution-based economics is based on the simple idea that we gain more by giving more, not by holding on to things that, truly, we could only create because we, in our turn, received from others. As it turns out, an economic system based on attribution -- where those who give more are more empowered -- is significantly more efficient than capitalism while also being stable and fair (unlike capitalism, on both counts), giving it transformative power to elevate the human condition and address the problems that face us today along with a host of others that have been intractable since the beginning. You can help make this a reality by releasing your work in the same way -- freely into the public domain in the simple hope of providing value. Learn more about attribution-based economics at drym.org, tell your friends, do your part.)