diff options
| author | Craig Jennings <c@cjennings.net> | 2026-09-13 09:46:11 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-09-13 09:46:11 -0500 |
| commit | 9c8d23eeddb72590234a424b449611256a540527 (patch) | |
| tree | 3f20df007506e858e26a6a732b21aebc1179cc35 /wttrin.el | |
| parent | f9449f6c8d4f5d174bea4a878632384f2b760c5f (diff) | |
| download | emacs-wttrin-9c8d23eeddb72590234a424b449611256a540527.tar.gz emacs-wttrin-9c8d23eeddb72590234a424b449611256a540527.zip | |
fix: key the cache on the effective display optionsrelease/0.4.0
wttrin--make-cache-key used the raw wttrin-display-options, so turning wttrin-hide-follow-line on or off produced the same key. A cached location then kept serving the old buffer with the Follow line. Nothing refreshes a non-favorite location in the background, so it stayed wrong until a forced refresh or eviction. The key now uses wttrin--effective-display-options, the flags actually sent to wttr.in.
Two tests pin it: the toggle changes the key, and the toggle and an explicit F flag share one key because they send the same request.
Diffstat (limited to 'wttrin.el')
| -rw-r--r-- | wttrin.el | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1522,10 +1522,12 @@ coordinates from a geolocation command." (defun wttrin--make-cache-key (location) "Create a cache key from LOCATION and every setting that shapes the response. Includes the unit system, display options, and Accept-Language, so changing any -of them produces a distinct key rather than serving a stale-format response." +of them produces a distinct key rather than serving a stale-format response. +The display options are the effective ones sent to wttr.in, so +`wttrin-hide-follow-line' changes the key and an equivalent request shares it." (format "%S" (list location (or wttrin-unit-system "default") - (or wttrin-display-options "") + (wttrin--effective-display-options) wttrin-default-languages))) (defun wttrin--get-cached-or-fetch (location callback) |
