Anju provides support for extracting a lambda (π) expression into a function declaration with the menu item βExtract πβ¦β. This feature requires that the point be on the lambda symbol. The screenshots below shows this command in operation.
The user will be prompted in the mini-buffer for a name of the new function. The example below shows add-two.
The result is that a temporary buffer named *add-two* (the input name is used) holding the new function is created and a reference to the new function (#'add-two) is substituted in-place at the original location of the lambda expression.
The *add-two* buffer can be edited as needed and its contents placed into a desired Elisp file.