Emacs is self-documenting in the sense that public variables functions and macros have documentation strings.
You get this string for
undo-tree-auto-save-history by typing C-h v
And is it going to auto-restore the undo-tree when opening a file ?
is answered in the doc-string:
When non-nil, `undo-tree-mode' will save undo history to file
when a buffer is saved to file.
It will automatically load undo history when a buffer is loaded
from file, if an undo save file exists.
By default, undo-tree history is saved to a file called
"..~undo-tree~" in the same directory as the
file itself. To save under a different directory, customize
`undo-tree-history-directory-alist' (see the documentation for
that variable for details).
Two possibilities to adjust that behavior:
- Customize the variable
undo-tree-auto-save-history with M-x
undo-tree-auto-save-history RET. Note that TAB-completion works.
(setq undo-tree-auto-save-history t) in your init file.