How can I recall the last region selected in emacs?

Viewed 1669

When I hit "undo" in emacs it undoes the my edit, but I lose the selected region, and I have to go back and reselect it. Is there a way to bind undo so it'll select the last selected region

The best I can come up with was:

(global-set-key (kbd "\C-o")
                (lambda()
                  (interactive)
                  (progn (undo)
                          (exchange-point-and-mark)
                          )))
2 Answers
Related