1

Assume that I open a file and start editing it (at least one character is inserted). Assume that the cursor is at Place A when the last change to the file is done (i.e. the last character is inserted). Then I take the cursor to another place in the same buffer (say place B). During this, I don't insert anything, but perhaps I execute some commands.

Is it possible to return from the place B to the original place A?

3

If you are okay with returning to the last edit (as opposed to last insertion), you might want to look at the package goto-chg. You can enable it like this:

(require 'goto-chg)

(global-set-key (kbd "C-.") #'goto-last-change)
(global-set-key (kbd "C-,") #'goto-last-change-reverse)
1

I know it's dumb compared to goto-chg, and also jumps to any kind of edit, not the last insertion, but I often undo, insert a space, and undo again (that space insert)... which places me back at the point of the last change.

  • The problem with this solution is that the first undo change the last edit, which may cause come inconveniences in some situations. Maybe I miss something... – Name Feb 2 '15 at 14:35
  • Right, so you make a new edit (insert space), then undo the edit and you're back at the original state. It's easier to do than to explain :) – Ted Zlatanov Feb 2 '15 at 19:19
  • Ok, I got it. Nice hack. – Name Feb 2 '15 at 20:36

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.