Closed symbiont-matthew-piziak closed 5 years ago
To reproduce, insert (+ 1 (* 2 3)), select (* 2 3), and run emr-el-extract-to-let. This results in the following:
(+ 1 (* 2 3))
(* 2 3)
emr-el-extract-to-let
(let ( (x (* 2 3))) (+ 1 x))
I would expect this instead:
(let ((x (* 2 3))) (+ 1 x))
This is only unsatisfying on the first variable extraction. Added variables work fine, since they are added to the body. If I start with this…
…and I extract y = 1, I get this…
y = 1
(let ((x (* 2 3)) (y 1)) (+ y x))
…which looks good to me.
Is this behavior expected, can I fix it? Or is this something I should be customizing somewhere else?
Possible fix here? https://github.com/Wilfred/emacs-refactor/pull/53
To reproduce, insert
(+ 1 (* 2 3))
, select(* 2 3)
, and runemr-el-extract-to-let
. This results in the following:I would expect this instead:
This is only unsatisfying on the first variable extraction. Added variables work fine, since they are added to the body. If I start with this…
…and I extract
y = 1
, I get this……which looks good to me.
Is this behavior expected, can I fix it? Or is this something I should be customizing somewhere else?