<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs-wttrin/tests/test-wttrin--get-cached-or-fetch.el, branch main</title>
<subtitle>Emacs frontend for Igor Chubin's wttr.in weather service
</subtitle>
<id>https://git.cjennings.net/emacs-wttrin/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/emacs-wttrin/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/'/>
<updated>2026-04-04T21:32:16+00:00</updated>
<entry>
<title>feat: specific error messages for fetch failures</title>
<updated>2026-04-04T21:32:16+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T21:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=73c81a00a10766900318d86640249d1b54c6b351'/>
<id>urn:sha1:73c81a00a10766900318d86640249d1b54c6b351</id>
<content type='text'>
Add HTTP status code checking (wttrin--extract-http-status) and pass
error descriptions through the callback chain so users see "Location
not found (HTTP 404)" or "Network error — check your connection"
instead of the generic "Perhaps the location was misspelled?" for
every failure.

Also fix pre-existing bug where the condition-case error handler in
extract-response-body killed an unrelated buffer after unwind-protect
already cleaned up.

330 tests (was 307), all passing.
</content>
</entry>
<entry>
<title>fix: cache timestamp reflects request time, not response time</title>
<updated>2026-04-04T18:24:01+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T18:24:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=752e2f825b1ee3eb513e27f2c03bcaef30eec767'/>
<id>urn:sha1:752e2f825b1ee3eb513e27f2c03bcaef30eec767</id>
<content type='text'>
float-time was captured in the outer let* before the async fetch.
The callback used this stale value, making cache entries appear
slightly older than they are. Move the float-time call into the
callback so the timestamp reflects when the data actually arrived.
</content>
</entry>
<entry>
<title>doc: update copyright years to 2026 and add missing author field</title>
<updated>2026-04-04T17:51:32+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T17:51:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=622ae39ad1e2544980cff73af8a5d5b2a64dacc8'/>
<id>urn:sha1:622ae39ad1e2544980cff73af8a5d5b2a64dacc8</id>
<content type='text'>
Update copyright headers across all 37 .el files to include 2026.
Add missing Author field to testutil-wttrin.el for consistency.
</content>
</entry>
<entry>
<title>feat: unified cache and staleness handling for mode-line and buffer</title>
<updated>2026-02-21T13:11:03+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-02-21T13:06:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=b74b98f177d92d50ddbede900ba41212e07c5f63'/>
<id>urn:sha1:b74b98f177d92d50ddbede900ba41212e07c5f63</id>
<content type='text'>
Replace TTL-based cache invalidation with proactive scheduled refresh.
Both mode-line and buffer systems now follow: timer refreshes cache,
display reads from cache, staleness indicated when data is old.

Phase 1 - Mode-line cache formalization + staleness display:
- Replace wttrin--mode-line-tooltip-data with wttrin--mode-line-cache
  as (timestamp . data) cons cell matching buffer cache pattern
- Add wttrin--format-age helper for human-readable age strings
- Rewrite wttrin--mode-line-update-display to take no arguments,
  read from cache, compute staleness (age &gt; 2x refresh interval),
  dim emoji gray when stale, show staleness info in tooltip
- Rewrite wttrin--mode-line-fetch-weather to write cache on success,
  show stale display on failure with cache, error placeholder without
- Add wttrin--mode-line-update-placeholder-error for first-launch failure

Phase 2 - Remove TTL, add proactive buffer refresh:
- Rename wttrin-cache-ttl to wttrin-refresh-interval (default 3600s)
  with define-obsolete-variable-alias for backward compatibility
- Change wttrin-mode-line-refresh-interval default from 900 to 3600
- Remove TTL check from wttrin--get-cached-or-fetch; serve cached data
  regardless of age, background timer keeps it fresh
- Add buffer refresh timer (wttrin--buffer-cache-refresh)

Phase 3 - Buffer staleness display:
- Add wttrin--format-staleness-header for buffer age display
- Insert staleness line in wttrin--display-weather before instructions

Phase 4 - Cleanup:
- Remove all references to wttrin--mode-line-tooltip-data
- Update README.org cache settings and mode-line documentation
- Update tests for new API (198 tests across 21 files, all passing)
</content>
</entry>
<entry>
<title>fix(wttrin): Fix ANSI color rendering on fresh Emacs launch</title>
<updated>2025-11-05T01:21:34+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-05T01:21:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=7673e72ed4dc4af9c3db9a5962c4673bd1ce90e3'/>
<id>urn:sha1:7673e72ed4dc4af9c3db9a5962c4673bd1ce90e3</id>
<content type='text'>
  Critical bug fix: On fresh Emacs launch, weather displayed with only
  double quotes colored blue, all other text white. Pressing 'g' to
  refresh brought colors back.

  Root cause: wttrin-mode (derived mode) calls kill-all-local-variables
  internally. The code was setting xterm-color--state buffer-local BEFORE
  calling wttrin-mode, so the state was immediately wiped out. On refresh,
  the mode was already active (no-op), so the state survived.

  Fix: Call wttrin-mode FIRST, then set buffer-local variables after.
  This ensures kill-all-local-variables runs before we set any state.

  Changes:
  - Reorder initialization in wttrin--display-weather (wttrin.el:277-285)
  - Add regression tests for mode initialization order (2 new tests)

  Test results: 65 tests, all passing
</content>
</entry>
</feed>
