emacscollective / no-littering

Help keeping ~/.config/emacs clean
GNU General Public License v3.0
635 stars 69 forks source link

no-littering breaks savehist-mode #88

Closed alienbogart closed 5 years ago

alienbogart commented 5 years ago

When no-littering is enabled, savehist-mode doesn't load the history on startup.

alienbogart commented 5 years ago

The following configuration solves the problem:

(use-package savehist
:config
(savehist-mode t))

(use-package no-littering
:after savehist
:ensure t)
dieggsy commented 5 years ago

@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.

alienbogart commented 5 years ago

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.

alienbogart commented 5 years ago

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.

gety9 commented 8 months ago

@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)

tarsius commented 8 months ago

The readme now contains information concerning these features: https://github.com/emacscollective/no-littering#auto-save-backup-and-undo-tree-files.