Questions tagged [mark-ring]

19 questions
48
votes
12 answers

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

Sometimes I find myself frequently alternating between two functions that I am editing in conjunction with each other. In these situations, it is tedious and painful to keep on doing a C-s to switch to the other function and then to…
Vedaad Shakib
  • 583
  • 4
  • 6
42
votes
6 answers

Effectively using the mark ring

I have used the mark to select regions of a buffer. For example, I know the sequence C- C-s foo can be used to select all text between the current point and the point after a search for foo. I recently discovered the existence of the mark…
Patrick Steele
  • 1,105
  • 9
  • 10
9
votes
1 answer

How to set mark in elisp and have shift selection?

The normal behavior of Emacs when transient-mark-mode is active is that when you make a shift-selection, then if the next command is a non-shift movement, the mark is deactivated. For example, after the commands M-l (to mark the current line with…
mikl
  • 413
  • 3
  • 19
7
votes
3 answers

How do I view the mark ring?

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…
extremeaxe5
  • 639
  • 3
  • 10
4
votes
1 answer

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

I have just explore how to use mark rings in emacs. There are two kind of mark type mark-ring and global-mark-ring. What are the differences between them and is there any option to push all marks to global to reaching from everywhere?
itirazimvar
  • 568
  • 4
  • 15
4
votes
2 answers

Activating the region without altering the mark ring

Setting the mark and moving point activates the region, which appears highlighted (assuming transient-mark-mode is enabled). Once the mark is set it's location is sent to the mark ring, thus changing it. Is it possible to activate the region without…
undostres
  • 1,793
  • 12
  • 15
3
votes
2 answers

How to jump to a mark using Elisp

Suppose I store the current mark into a variable using mark or (mark-marker). Then I move point elsewhere and insert some text. Which function should I use to jump to the saved mark?
Tu Do
  • 6,772
  • 20
  • 39
3
votes
1 answer

calling xref-find-definitions within lisp code

I want to call xref-find-definitions from within my own lisp code and I'm struggling. (xref-find-definitions IDENTIFIER) Find the definition of the identifier at point. It wants a parameter but I don't understand what parameter to supply because…
2
votes
1 answer

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

When I use helm-mark-ring or helm-imenu, I would like to jump to the current candidate automatically in the other buffer while keeping the helm session (i.e., similar to helm-swoop). I tried the following codes mentioned on this thread, but didn't…
AhLeung
  • 1,083
  • 5
  • 14
2
votes
1 answer

Back/forward navigation that works like IntelliJ/Eclipse

I've been trying to find a navigation package that allows backwards/forwards navigation across and within buffers. I have found a lot of solutions out there but none of them seem to solve the whole problem. Here are the requirements: Should work…
leeor
  • 141
  • 4
2
votes
1 answer

pop-mark not working as expected

I have some sample code like this: (defun some-function () (interactive) (push-mark) (goto-char (point-min)) ; do some stuff (pop-mark)) Now I'm expecting pop-mark to get me back to the original location. But that doesn't seem to be…
Sibi
  • 3,603
  • 2
  • 22
  • 35
1
vote
2 answers

Looking for a "point ring"

Is there something like a point ring in Emacs? I would like to store the current point in there using a command similar to point-to-register. But when I store another point, I want the previous one preserved. Later I want to list all the points in…
Witek
  • 335
  • 1
  • 11
1
vote
1 answer

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

Newbie here, but oddly I couldn't find an answer to this by Googling. How do I clear all marks from the current buffer? I did find how to view the mark ring, but not how to clear all marks from current buffer.
1
vote
0 answers

Implement vim's Ctrl-O and Ctrl-I in emacs

I find this to be a great feature from vim, and I miss it. I've looked around, and it seems that one can add the current position to some mark ring, and then come back. But that's explicit. I need to know ahead that I'll need to remember where I am,…
Ivan Perez
  • 400
  • 2
  • 15
1
vote
1 answer

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

I am wondering why it is so difficult to go back when you mix local and global jumps in Emacs. Maybe I am missing something. For example, if I am in buffer 1 and jump to position 100 (for example using a search command or a bookmark jump), then…
Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51
1
2