02 August, 2009
Emacs: goto last edit
Finally, it's back. Sort of.
I once knew a binding for Emacs that would jump to the last edited location in a buffer. It was great while writing my thesis, because I could go and check on something (like what I'd called a label for a \pageref).
But then I created scripts that grepped, awked and seded my thesis to produce lists of labels, which I then ran in watch inside a transparent xterm on another desktop, for easy look-ups. Simple and pleasingly distracting for the half and hour it took to set up. I'm a master procrastinator.
So I forgot the binding and have never managed to find it again.
I have now found something that does the same, though. Here's how to get it working:
- Download goto-last-change.el from http://www.emacswiki.org/emacs/goto-last-change.el
- Put it in /usr/share/emacs/site-lisp/, or in your personal scripts directory if you have one.
Next, add something like the following in your .emacs:
;;go to last edit point
(global-set-key [(meta p)(u)] 'goto-last-change)
And now M-p u will allow you to jump back to the last place you edited.
I still wish I could remember the old binding. I know it's in there somewhere. I think it uses M-# somewhere
Labels: emacs lisp editor config