• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cjennings / emacs-wttrin / 26272814128
94%

Build:
DEFAULT BRANCH: main
Ran 22 May 2026 06:45AM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 May 2026 03:06PM UTC coverage: 94.444% (+0.3%) from 94.156%
26272814128

push

github

cjennings
feat: support t for auto-detect via geolocation in wttrin-favorite-location

Completes the three-mode configuration the favorite-location feature was always meant to have:

- nil      — disabled (default; unchanged)
- a string — explicit location (unchanged)
- t        — auto-detect via IP geolocation (NEW)

When the user sets `wttrin-favorite-location` to t, wttrin runs the geolocation lookup once on first use and caches the result for the session. Subsequent reads return the cached string. The lookup happens in the background via the existing `wttrin-geolocation-detect`, so Emacs startup is never blocked.

I added two private state vars (`wttrin--resolved-favorite-location`, `wttrin--favorite-location-pending`) and a resolver `wttrin--resolve-favorite-location` that maps the three modes onto a returned string or nil. When t is set and the cache is empty, the resolver kicks off the lookup and returns nil for that call — the next consumer tick after the callback completes gets the cached string. The pending flag prevents duplicate concurrent lookups when several consumers ask during the resolution window.

Five consumer call sites now go through the resolver instead of reading `wttrin-favorite-location` directly: `wttrin--mode-line-fetch-weather`, `wttrin-mode-line-click`, `wttrin-mode-line-force-refresh`, `wttrin--buffer-cache-refresh`, and `wttrin--mode-line-start`. Two display sites (the placeholder and error tooltips) use a new `wttrin--favorite-location-display-name` helper that returns "current location" while a t-mode lookup is pending, instead of showing the literal `t` to the user.

Tests cover the resolver across all three modes, including the pending state, the duplicate-suppression behavior, and detection-failure retry. Existing consumer tests stay green because the resolver returns the bound string unchanged when the variable is a string. One care: the test file requires wttrin-geolocation up front so cl-letf mocks of `wttrin-geolocation-... (continued)

47 of 48 new or added lines in 1 file covered. (97.92%)

459 of 486 relevant lines covered (94.44%)

12.98 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
93.21
0.45% wttrin.el
Jobs
ID Job ID Ran Files Coverage
1 26272814128.1 22 May 2026 06:45AM UTC 3
94.44
GitHub Action Run
Source Files on build 26272814128
  • Tree
  • List 3
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26272814128
  • 541586e3 on github
  • Prev Build on main (#25383586187)
  • Next Build on main (#26993483271)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc