aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-21 08:48:04 -0400
committerCraig Jennings <c@cjennings.net>2026-06-21 08:48:04 -0400
commit72cb7cfc64b884965835afaac3f3877fdb1dcb57 (patch)
tree6ebccde4131d28cbe16d8b259fbe251f7b29430d /README.org
parent55c60f025e834c6bc60523542644ac0ec03d035c (diff)
downloademacs-wttrin-72cb7cfc64b884965835afaac3f3877fdb1dcb57.tar.gz
emacs-wttrin-72cb7cfc64b884965835afaac3f3877fdb1dcb57.zip
feat: add persistent location search history
Successful searches are now remembered and offered as completion candidates the next time you run wttrin, listed after the configured defaults. Only successful fetches are saved, so typos and not-found locations never enter the history. A location already in wttrin-default-locations isn't duplicated into it. The list is capped at wttrin-location-history-max (default 20), oldest entries falling off first. Persistence uses savehist: the history variable is registered with savehist-additional-variables, so enabling savehist-mode carries it across restarts with no custom file I/O. Without savehist it lasts the session. Two commands manage the list: wttrin-remove-location-history drops one entry, wttrin-clear-location-history clears all. I don't pass the history variable as the completing-read history argument, because the minibuffer would then save every typed string, including failed lookups. It stays a curated candidate source, updated only on success. I trim with butlast rather than seq-take to keep the Emacs 24.4 baseline.
Diffstat (limited to 'README.org')
-rw-r--r--README.org18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.org b/README.org
index b6a824d..8fd3fd2 100644
--- a/README.org
+++ b/README.org
@@ -129,6 +129,24 @@ Most people will just want to add a bunch of cities to the location list. Howeve
"41.89,12.48")) ;; GPS Coordinates for Rome
#+end_src
+*** Location Search History
+
+Locations you search successfully are remembered and offered as completion candidates the next time you run =M-x wttrin=, listed after your configured defaults. Only successful lookups are saved, so typos and not-found locations never enter the history. A location already in =wttrin-default-locations= is not duplicated into the history.
+
+History is capped at =wttrin-location-history-max= entries (default 20); the oldest fall off as new ones arrive.
+
+#+begin_src emacs-lisp
+ (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.
+
+#+begin_src emacs-lisp
+ (savehist-mode 1)
+#+end_src
+
+Two commands manage the history: =M-x wttrin-remove-location-history= drops a single entry (with completion), and =M-x wttrin-clear-location-history= clears all of it.
+
*** Default Language
Customizing 'wttrin-default-languages' allows users to tell Wttrin which language to request for the text it displays. For instance, this changes the language used for days of the week, periods of the day, and other related text.