Sometimes I'm inside a long function where the start of the function is not visible. While I have recently learned about (which-function-mode)
which tells me in the modeline the name of the function, I'd like to be able to quickly jump to the start of the function and then back as easily as possible.
So far I've found two solutions.
Using a mark
C-SPC
Mark current pointC-M-a
Move backward to start of functionC-x C-x
Exchange mark with current point (jumps you back)C-g
Cancel marked regionUsing a register
C-x r SPC p
Save current point in register 'p'C-M-a
Move backward to start of functionC-x r j p
Jump to point saved in register 'p'
Is there a better way? I'm not opposed to adding some elisp to my .emacs
file.