Purpose: When you visit a file, point goes to the last place where it was when you previously visited the same file.
To use it, turn it on in the options menu - “Save place in files between Sessions”.
Alternatively, you could add the following to your InitFile:
saveplace is auto-loaded by
save-place-mode. So you do not need to explicitly require it.
(require 'saveplace) (setq-default save-place t)
Note that using
setq will not do because the variable is buffer-local.
Your saved places are written to the file stored in the file specified by
save-place-file. This defaults to
~/.emacs.d/places in newer emacs versions (25.1+) and to
~/.emacs-places in older emacs versions. In the latter case, you might want to change it to keep your home directory uncluttered.
(setq save-place-file (locate-user-emacs-file "places" ".emacs-places"))
If emacs is slow to exit after enabling saveplace, you may be running afoul of
save-place-forget-unreadable-files. On exit, it checks that every loaded file is readable before saving its buffer position - potentially very slow if you use NFS.
(setq save-place-forget-unreadable-files nil)
will restores emacs exit to nearly instantaneous.