Adapting to a rather functional programming style, I often end up with files consisting of a lot of individual function definitions. Oftentimes, I then decide at some later point that I want to reorder those in some way as to facilitate understanding of the code, e.g. most general functions on top/ less general functions after, ...
At the moment I am mostly using manual killing and yanking to do this but find this rather cumbersome and time-consuming.
Is there a good (and maybe canonical) way in Emacs to do that? Ideally, I could call some command that presents me with a new buffer of all function names (one per line) and each change in that buffer would automatically update the order of the functions in my code-buffer (and vice-versa).
If only mode-specific solutions exist (which is probably all I can hope for since source code parsing is required) I would be interested in the following languages:
- Haskell
- Elisp
- Python
imenu
and its clones), but the way to approach it would be to usemark-defun
which should use mode-specific implementation to select a definition. Then have some occur-like buffer where you can bind keys to moving reduced representation of definitions around. – wvxvw Feb 16 '18 at 13:25