aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-24 00:10:51 -0400
committerCraig Jennings <c@cjennings.net>2026-06-24 00:10:51 -0400
commitefd3cdce5b3aebfdb3e02460d1ec0434cef85949 (patch)
treeae8746cc7699b7e989d253f4c816fc7798a8e040 /README.org
parent4d46eafaa087f5570ece9d2e5f5d2ba6bc0d824e (diff)
downloademacs-wttrin-efd3cdce5b3aebfdb3e02460d1ec0434cef85949.tar.gz
emacs-wttrin-efd3cdce5b3aebfdb3e02460d1ec0434cef85949.zip
feat: add 'd' key to make the displayed location the defaultHEADmain
I bound d in the weather buffer to wttrin-make-default, which sets wttrin-favorite-location to the location on screen so it drives the mode-line and future sessions. The footer advertises "[d] to make default". Persistence rides savehist, not the Emacs custom-variable mechanism: wttrin--savehist-register registers wttrin-favorite-location alongside the search history, at load and on savehist-save-hook. Enable savehist-mode and the favorite survives restarts. Promoting a location drops it from the search history, the way wttrin-default-locations entries are kept out of history. The favorite shows in the picker instead: wttrin--completion-candidates prepends it when it's a string and not already a default, so it appears exactly once. The setter only assigns the variable and trims history. It doesn't register with savehist itself, because savehist-additional-variables is unbound until savehist loads, so a direct add-to-list would error for users without savehist. Registration stays on the load and save-hook path.
Diffstat (limited to 'README.org')
-rw-r--r--README.org4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.org b/README.org
index 82b36b4..909bd52 100644
--- a/README.org
+++ b/README.org
@@ -106,7 +106,9 @@ Simply use the keybinding you assigned, or run `M-x wttrin` to display the weath
[[assets/location-menu.png]]
-Choose one, or for a quick one-time weather check, type a new location and ⏎ . After the weather is displayed, you can press `a` to check another location, `g` to refresh, or `q` to quit.
+Choose one, or for a quick one-time weather check, type a new location and ⏎ . After the weather is displayed, you can press `a` to check another location, `g` to refresh, `d` to make the shown location your default, or `q` to quit.
+
+Pressing `d` sets =wttrin-favorite-location= to the location on screen and remembers it across restarts (via savehist), so the mode-line and future sessions follow it. Your default is also offered in the location list the next time you run =M-x wttrin=. Enable =savehist-mode= for the persistence to stick.
If you're looking at cached data, a line below the weather art tells you how old it is (e.g., "Last updated: 2:30 PM (5 minutes ago)").