Registers:
C-xrSPC runs point-to-register
C-xrj runs jump-to-register
Type any character to specify a register when prompted.1
Bookmarks:
C-xrm runs bookmark-set
C-xrb runs bookmark-jump
Mark ring:
C-SPCC-SPC pushes the current position to the mark ring (without leaving it active).
C-uC-SPC pops the mark ring, jumping to the previous position. You can use this repeatedly to navigate through the entire ring.
Note that some commands (especially ones which are liable to move you an an unknown or arbitrary distance from your original location) will automatically push to the mark ring so that you can use C-uC-SPC to return afterwards. This includes isearch
, so after using C-s to go somewhere, you can easily jump back again.
Exchange point and mark:
And as Tu Do comments, C-xC-x runs exchange-point-and-mark
which is very useful for jumping between two locations. It also activates the mark/region by default. You can use C-u C-x C-x to avoid this, or C-SPC to clear the highlighting.
1 If you're taking advantage of register functionality in elisp, use some non-conflicting symbol for the name, rather than a char, so that you can't conflict with interactively-set registers (unless, of course, you want to do that).