I'd like to have a command that moves the cursor to the last position it was in when I left the buffer (either by killing it or by killing Emacs).
I know I can use saveplace.el to save the position for when I visit that file again, but then saveplace also takes the cursor to that position automatically, while I would like to leave the cursor at the beginning of the buffer, and move to the last position only when I want to do it, using a command. (Basically, like `" does in Vim.)
save-hist-additional-variables
. And depending on the when you can use a particular hook - there are hooks for buffer switching, quitting Emacs, etc.