From the following code
(defun foo ()
(defun bar1 ()
(do-something)))
(defun bar2 ()
(do-something))
I want to make the following
(defun foo ()
(defun bar1 ()
(do-something)))
(defun foo ()
(defun bar2 ()
(do-something)))
Note that, I have to make a copy of foo
then replace bar1
with bar2
in the copied code
I wonder if I can shorten it by copying foo
's outer region and wrap bar2
with the outer region
Surely, this can be done if the wrapped code is something simple like a parenthesis (For instance, smartparens can help with that)
foo
? I suspect that this is an X-Y-problem. Tell us what you actually want to achieve.