0

In buffer B, I press C-x r SPC r to store the position of point.

I switch to buffer A and do some work. I then press C-x r j r to return to the position I saved in buffer B.

How do I get back to the position I left in buffer A? The following do not give the required result: C-x C-x, C-u C-SPC or C-x C-@.

My understanding is that C-x r j r will push the position onto the global mark ring and that C-u C-SPC will take me back there.

2
  • C-x C-@ should work. What does happen instead? Commented Apr 26, 2022 at 15:02
  • @PhilHudson That takes me somewhere else in the current buffer.
    – SabreWolfy
    Commented Apr 26, 2022 at 19:28

1 Answer 1

1

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 a ring, but stack for our current purposes). Each C-x C-@ pops one off the stack and jumps to it. Try repeating C-x C-@ multiple times. You should see point move to more-or-less recognizable places where you did something other than just typing, one after another.

2
  • So C-x C-@ will not return point to where it was when I pressed C-x r j r? I expected that that would be the last entry in the global mark ring. Note that after jumping to the saved register position in buffer B, I don't move point. I just read what is there, and then I want to jump back to buffer A. Thinking about it now though -- the solution would be to just switch buffers with C-x b? :-/
    – SabreWolfy
    Commented Apr 27, 2022 at 10:31
  • A single C-x C-@ will not necessarily return point to where it was. If you execute it immediately then it should return point to where it was. Switching buffers is neither necessary nor optimal if everything's working right, but you can certainly do that. Commented Apr 27, 2022 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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