From eaabae3b01b8bdc05a5892492c06a8131c195a45 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 21 Jun 2026 09:11:38 -0400 Subject: fix: keep location history registered after a savehist setq A one-time add-to-list put wttrin--location-history into savehist-additional-variables when savehist loaded. Any user who later setqs that list, a common config pattern for curating which histories persist, replaces it and drops the entry. The search history then silently never saves. Re-assert the registration on savehist-save-hook, which runs at the top of every savehist-save. The variable is now in the list whenever a save happens, regardless of init order or a clobbering setq. Restore was never affected, since savehist reloads the value from explicit setq forms in its file. The README persistence note now reflects this: the variable stays registered even if you set savehist-additional-variables yourself. --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 8fd3fd2..658c4ed 100644 --- a/README.org +++ b/README.org @@ -139,7 +139,7 @@ History is capped at =wttrin-location-history-max= entries (default 20); the old (setq wttrin-location-history-max 20) #+end_src -To persist the history across Emacs restarts, enable the built-in =savehist-mode= (Wttrin registers its history variable automatically). Without it, history lasts for the session only. +To persist the history across Emacs restarts, enable the built-in =savehist-mode=. Wttrin keeps its history variable registered automatically, even if you set =savehist-additional-variables= yourself, so there is nothing else to configure. Without =savehist-mode=, history lasts for the session only. #+begin_src emacs-lisp (savehist-mode 1) -- cgit v1.2.3