You can use 'Registers'.
From emacs info file
13.1 Saving Positions in Registers
C-x r <SPC> R
Record the position of point and the current buffer in register R
(point-to-register)
.
C-x r j R
Jump to the position and buffer saved in register R
(jump-to-register)
.
Typing C-x r <SPC>
(point-to-register)
, followed by a character
'R', saves both the position of point and the current buffer in
register R. The register retains this information until you store
something else in it.
The command C-x r j R
switches to the buffer recorded in register
R, and moves point to the recorded position. The contents of the
register are not changed, so you can jump to the saved position any
number of times.
If you use C-x r j
to go to a saved position, but the buffer it
was saved from has been killed, C-x r j
tries to create the buffer
again by visiting the same file. Of course, this works only for buffers
that were visiting files.
C-x x
which runsexchange-point-and-mark
do? Emacs doesn't store all cursor movements, only those you specifically told it to. Adding and popping marks is one way of storing cursor movement history. emacswiki.org/emacs/MarkCommands - here's a good discussion of the subject.C-x x
is undefine.M-x exchange-point-and-mark
: no mark set in this buffer.C-x C-x
. Also you need to set a mark first for that to work. To set a mark explicitly, you doC-SPC
. To jump back to the previous mark, you doC-u C-SPC
.C-x C-x
.C-x x
is my own binding.