Search code examples
emacscommandmovepointkey-bindings

In Emacs, what is the command to move the pointer to the location of the last edit?


What lisp config command would bind this command, if it's not already bound?

Also, If I wanted to bind C-x h, C-M-\, and , to a single C-M-\, how would this be done?

Thanks in advance


Solution

  • The function session-jump-to-last-change is part of session.el which I typically bind to these two key sequences for convenience: C-xC-/ and C-A-/. I pick those keys because it is similar to undo which is bound by default to C-/.

    (autoload 'session-jump-to-last-change "session")
    (global-set-key (kbd "C-x C-/") 'session-jump-to-last-change)
    (global-set-key (kbd "C-A-/") 'session-jump-to-last-change)