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-SPCMark current pointC-M-aMove backward to start of functionC-x C-xExchange mark with current point (jumps you back)C-gCancel marked regionUsing a register
C-x r SPC pSave current point in register 'p'C-M-aMove backward to start of functionC-x r j pJump to point saved in register 'p'
Is there a better way? I'm not opposed to adding some elisp to my .emacs file.
set-mark-command– Harvey Oct 24 '14 at 13:24pop-to-mark-command(which is what is called byC-u C-SPC), you will wonder how you lived without it. You can find your way back where you came from by following a little trail of breadcrumbs that you didn't even know you were leaving. – nispio Oct 24 '14 at 14:30