Emacs: Cycle Marks (Cycle local mark ring) 🚀

By Xah Lee. Date: .

put this in your Emacs Init File:

(defun xah-pop-local-mark-ring ()
  "Move cursor to last mark position of current buffer.
Repeat call cycles all positions in `mark-ring'.

URL `http://xahlee.info/emacs/emacs/emacs_cycle_local_mark_ring.html'
Version: 2016-04-04 2023-09-03"
  (interactive)
  (set-mark-command t))

give the command a easy key.

(global-set-key (kbd "C-0") 'xah-pop-local-mark-ring)
(global-set-key (kbd "C-9") 'pop-global-mark)

〔see Emacs Keys: Define Key〕

Emacs Mark Ring