(autoload 'try-code "try-code" nil t) (global-set-key (kbd "C-?") 'try-code)
Scenario: you want to try an alternative implementation of a function while keeping the original within reach.
- Select lines.
- (optional) C-y (yank original implementation)
- make changes as required
- press C-? again
When you reinvoke the function, you can choose which implementation to keep.
Try it out; bug reports are welcome.