I saved point to register, closed buffer / restarted Emacs and got:
user-error: That register’s buffer no longer exists
I want Emacs to open file if necessary and go to point.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityI tried bookmarks and they survive buffer closing and Emacs reloading:
(info "Bookmarks (emacs)")
“Bookmarks” are somewhat like registers in that they record positions you can jump to. Unlike registers, they have long names, and they persist automatically from one Emacs session to the next. The prototypical use of bookmarks is to record where you were reading in various files.
Even more! ~/.emacs.d/bookmarks
keeps lines like:
(("wsl"
(filename . "~/my/gtd/BLOG.rst")
(front-context-string . "\nLegacy WSL was ")
(rear-context-string . "larms.\n\nWSL\n===\n")
(position . 1052073))
so Emacs is able to point cursor to the same position even if you edit surrounding (add/remove lines). See bookmark-search-size
.