What variable or function I need to use to jump to the place of the marker set by set-mark-command
C-SPC
using goto-char
?
(defun jump-to-mark ()
(interactive)
(goto-char <WHAT PUT HERE>))
The exchange-point-and-mark
command (bound to C-xC-x) jumps to the mark, and puts the current position (i.e. just before the jump) on top of the mark ring.
A side effect is that the region is activated. You can pass a prefix argument (i.e. press C-uC-xC-x) to avoid this.
As mentioned in other answers, another way to navigate in the mark ring consists in using C-uC-SPC, which jumps to the mark and removes it from the mark ring. Repeating the command thus makes you navigate through all successive mark positions in reverse-chronological order. However, mark positions visited that way are lost.
A sibling of C-uC-SPC is C-xC-SPC, which is very similar but acts on the global mark ring, which stores successive marks in all buffers.
I just found that it's mark-marker
so my function to jump should be:
(defun jump-to-mark ()
(interactive)
(goto-char (mark-marker)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With