Suppose I have this code
(hello world) (hi world)
Then it occurs to me that I should wrap this as follows:
(let (acc) <> (nreverse acc))
bringing this code:
(let (acc) (hello world) (hi world) (nreverse acc))
This is how I usually do the wrapper. First, I write an incomplete external form in front of such wrapped forms:
(let (acc)) (hello world) (hi world)
Then I paredit-forward-slurp-sexp C-) twice ( paredit-forward-slurp-sexp ) to separate things:
(let (acc) (hello world) (hi world))
Then I end up adding (nreverse acc) at the end.
Now I wonder, what if I started writing the full external form template first, how is it?
(let (acc) (nreverse acc)) (hello world) (hi world)
or how is it
(hello world) (hi world) (let (acc) (nreverse acc))
Is there a short sequence of paredit or non-paredit commands that I can click to finish the job from this run?
I could move the point, cut out the two shapes to be wrapped, move the point, paste the shapes. But I wonder if there is a more convenient way.
I am happy with the way I do the wrapping, but it seems to me that I can skip some other neat editing tricks that can be found from a different start.
source share