I was trying to make persistent undo history work in emacs.
I have (setq undo-tree-auto-save history t)
. The history is indeed saved when I save file. But when I open file, the undo history is not loaded until I use undo.
So if I open a file and make some changes, then run M-x undo-tree-visualize
, the previous undo tree is gone, only the recent changes are there. But if I run M-x undo-tree-visualize
first, then I can see the old undo tree. Or if I just use undo before making any changes, the old undo history is loaded and the undo works as expected.
Edit: My configuration looks like this: https://gitlab.com/snippets/22693
Edit2: This problem still happens with the most minimal configure file:
;;; init.el --- user init file -*- no-byte-compile: t -*-
(load-file "~/.emacs.d/undo-tree.el")
(global-undo-tree-mode 1)
(setq undo-tree-auto-save-history t)
(global-undo-tree-mode 1)
. Please show us your configuration.