Skip to main content
10 votes
Accepted

How do I view the mark ring?

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 ...
Alexandr Karbivnichyi's user avatar
10 votes
Accepted

How to set mark in elisp and have shift selection?

Because shift translation and temporary activation of the mark is handled by the command loop, you will need to call the interactive versions of the movement functions in order to get the appropriate ...
nispio's user avatar
  • 8,245
6 votes

How to switch back and forth between two locations in a buffer

For the past 20 years or so, I've been using these two gems: (defun ska-point-to-register () "Store cursorposition _fast_ in a register. Use ska-jump-to-register to jump back to the stored position....
Stefan Kamphausen's user avatar
4 votes
Accepted

What are the differences mark-ring and global-mark-ring?

You should pose only one question per question here. For your first question: *What are the differences between the mark-ring and the global-mark-ring: This is answered very well in the Emacs manual,...
Drew's user avatar
  • 78k
3 votes
Accepted

How to automatically set marks on all of the edited lines?

There's a built-in package hilit-chg which tracks and highlights the changes applied to a buffer. I disable its highlight and but just use as a change-tracker. The mode automatically put text-...
zk_phi's user avatar
  • 446
3 votes

How do I view the mark ring?

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)
Rémi's user avatar
  • 1,617
3 votes

calling xref-find-definitions within lisp code

You can call xref-find-definitions programatically by (xref-find-definitions (symbol-name (symbol-at-point))) or if you want to be prompted for an identifier (funcall-interactively #'xref-find-...
Kevin's user avatar
  • 96
2 votes

How do I view the mark ring?

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, ...
Drew's user avatar
  • 78k
2 votes

Looking for a "point ring"

You need to read the Emacs manual about the mark-ring and the global-mark-ring. The basics: Use C-SPC C-SPCto set the mark at some location. (The firstC-SPC` is enough to set it, but if that's all you ...
Drew's user avatar
  • 78k
2 votes

How do I clear all marks from the current buffer mark ring?

M-: (setq mark-ring ()) That is, just set variable mark-ring to nil.
Drew's user avatar
  • 78k
1 vote

Looking for a "point ring"

If you want to store positions only manually I have a library that can do that. It doesn't use a ring though, it uses a stack. You can download it from Codeberg. Put it in a path in your load-path (...
Arch Stanton's user avatar
  • 1,707
1 vote

Jump to global mark ring after jumping to register

That sounds like what you'd expect if "do some work" included, once or more, any of the many actions that set the mark. Each of those actions pushes another mark onto the stack (technically ...
Phil Hudson's user avatar
  • 1,796
1 vote

How to switch back and forth between two locations in a buffer

You can also take advantage of macros, since they can be quickly bound to convenient keys. For example, record a jump to position N using <F3> M-g g N <F4> and assign it to key F5 with C-...
memeplex's user avatar
  • 429
1 vote
Accepted

Why is the mark ring called a 'ring' and not a 'stack'?

The Elisp manual, node Rings, tells you about rings in Emacs. It starts off with a description: A ring is a fixed-size data structure that supports insertion, deletion, rotation, and modulo-indexed ...
Drew's user avatar
  • 78k
1 vote

How can I return back to point position after jumping by `<down-mouse-1>`?

(defun my-mouse-1 (event) "..." (interactive "e") (mouse-set-point event) (push-mark)) (global-set-key (kbd "<mouse-1>") 'my-mouse-1) (Not that I really recommend doing this. You won'...
Drew's user avatar
  • 78k
1 vote

Traversing the mark rings when combining global and local jumps in Emacs

If you can choose among markers in all buffers then you need to be able to choose one, and that means identifying the buffer and the marker in it that you want. That is, I believe, the answer to your ...
Drew's user avatar
  • 78k
1 vote
Accepted

How to make helm-mark-ring/helm-imenu follow current candidate

Put this in your .emacs (setq helm-follow-mode-persistent t) and whenever you enter helm-imenu or helm-mark-ring, press C-<up> or C-<down> to follow to that line in helm.
Chakravarthy Raghunandan's user avatar
1 vote

Back/forward navigation that works like IntelliJ/Eclipse

[First, I'll say up front that this answer does not satisfy your second requirement, which is to use more than just markers as points to visit. I mention it anyway, because I think it could help, if ...
Drew's user avatar
  • 78k

Only top scored, non community-wiki answers of a minimum length are eligible