How do I transpose the function symbols in a parent and child sexp?

111 views Asked by At

What I have:

(abs (/ total 2))

What I'm looking for:

(/ (abs total) 2)

I'm pretty sure there's a command in emacs for that, although I can't find one in docs. If it matters, I use spacemacs.

1

There are 1 answers

1
jeffkowalski On

sp-convolute-sexp from the smartparens package would almost do it.

It can transform

(abs (/ |total 2))

to

(/ (abs |total 2))

(where | is the point)

But it's not aware of the unary / binary difference between "abs" and "/". Maybe that function is a starting point for a solution?