Closed alienbogart closed 5 years ago
The following configuration solves the problem:
(use-package savehist
:config
(savehist-mode t))
(use-package no-littering
:after savehist
:ensure t)
@mrbig033 A guess, but that might just be because no-literring changes where the history is actually saved ? in your original scenario savehist is loading history from the new, changed location (which may not have saved history yet), whereas in the second savehist loads the original file, but then starts saving history to the new file.
You may want to copy the original history file over if you want it saved.
So, my solution is not a good one, because now savehist saves to /var/, but it is not loaded correctly. It's actually loading history
from ~.emacs.d~, which is actually and old file with just five lines of history. Really annoying.
I added (setq savehist-file "~/.emacs.d/var/savehist.el")
to savehist as such:
(use-package savehist
:init
(setq savehist-file "~/.emacs.d/var/savehist.el")
:config
(setq history-length 500)
(setq savehist-additional-variables '(kill-ring search-ring))
(savehist-mode t))
And I think it's working now. I'll reopen if there's a change.
@alienbogart i know it's super old thread, but are your still using similar config for savehist and no littering? (i have problems with savehist on emacs 29)
The readme now contains information concerning these features: https://github.com/emacscollective/no-littering#auto-save-backup-and-undo-tree-files.
When
no-littering
is enabled,savehist-mode
doesn't load the history on startup.