5

Is there a command to view the entries in the mark ring, similar to listing buffers with C-x C-b or viewing the kill ring with the function browse-kill-ring or viewing the jump list (in info mode) with L?

It doesn't need to be bound to a key -- I don't even know of (and cannot find) any function that does this.

6

C-h v mark-ring

C-h v global-mark-ring

A ring is an elisp data structure. It can be created by make-ring function and assigned to any variable.

Each buffer remembers previous locations of the mark, in the “mark ring”.

That “mark ring” is an elisp variable mark-ring that is a buffer local variable(each buffer has its own value of that variable). mark-ring is declared in emacs/26.1/lisp/simple.el, and core push/pop functions operate on this variable.
To view value of mark-ring variable in a current buffer: C-h v mark-ring

Other packages create/use their own rings; For example emacs/26.1/lisp/progmodes/xref.el ("crossreference)" that jumps to source code definitions uses xref--marker-ring variable to contain its marker ring:

(defvar xref--marker-ring (make-ring xref-marker-ring-length)
  "Ring of markers to implement the marker stack.")

ggtags uses it too.

To view value of global-mark-ring(not local, shared by all buffers): C-h v global-mark-ring

  • Hey, I'll make your answer the accepted one. Could you highlight (in some way) the two lines C-h v mark-ring and C-h v global-mark-ring? (As they're the ones that answer the question). I'll remove this comment when you've done so. – extremeaxe5 Jan 13 at 9:52
3

The helm package offer the M-x helm-all-mark-rings and M-x helm-mark-ring to interactively browse the mark-ring (the first show both global and local mark-ring when the latter show only the local one)

2

If you use Icicles then you can use C-SPC to go to any marker, choosing it using completion against the text of its line.

  • With no prefix arg or a positive prefix arg C-SPC is just set-mark-command, as usual in Emacs (set the mark).

  • C-0 C-SPC (prefix arg 0) invokes command icicle-goto-any-marker, which lets you choose any marker in any buffer.

  • C-- C-SPC (negative prefix arg) invokes icicle-goto-marker, which lets you choose a marker in the current buffer.

Each of the go-to-marker commands is a multi-command, which means you can act on any number of completion candidates, so you can navigate among the markers that match your current input in the minibuffer (with an empty minibuffer, all markers are candidates).

C-h f icicle-goto-marker:

icicle-goto-marker is an interactive Lisp function in icicles-cmd2.el.

It is bound to menu-bar search goto icicles icicle-goto-marker.

(icicle-goto-marker)

Go to a marker in this buffer, choosing it by the line that includes it.

If crosshairs.el is loaded, then the target position is highlighted.

By default, candidates are sorted in marker order, that is, with respect to their buffer positions. Use C-M-, or C-, to change the sort order.

During completion you can use these keys:

  • C-RET - Goto marker named by current completion candidate
  • C-down - Goto marker named by next completion candidate
  • C-up - Goto marker named by previous completion candidate
  • C-next - Goto marker named by next apropos-completion candidate
  • C-prior - Goto marker named by previous apropos-completion candidate
  • C-end - Goto marker named by next prefix-completion candidate
  • C-home - Goto marker named by previous prefix-completion candidate
  • <S-delete> - Delete marker named by current completion candidate

When candidate action and cycling are combined (e.g. C-next), option icicle-act-before-cycle-flag determines which occurs first.

With prefix C-M- instead of C-, the same keys (C-M-mouse-2, <C-M-f1>, C-M-down, and so on) provide help about candidates.

Use mouse-2, RET, or S-RET to choose a candidate as the final destination, or C-g’ to quit. This is an Icicles command - see command icicle-mode.

See also commands icicle-goto-any-marker and icicle-goto-global-marker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.