diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-21 08:48:04 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-21 08:48:04 -0400 |
| commit | 72cb7cfc64b884965835afaac3f3877fdb1dcb57 (patch) | |
| tree | 6ebccde4131d28cbe16d8b259fbe251f7b29430d /tests/test-wttrin--resolve-favorite-location.el | |
| parent | 55c60f025e834c6bc60523542644ac0ec03d035c (diff) | |
| download | emacs-wttrin-main.tar.gz emacs-wttrin-main.zip | |
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 'tests/test-wttrin--resolve-favorite-location.el')
0 files changed, 0 insertions, 0 deletions
