<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs-wttrin/wttrin-geolocation.el, branch release/0.4.0</title>
<subtitle>Emacs frontend for Igor Chubin's wttr.in weather service
</subtitle>
<id>https://git.cjennings.net/emacs-wttrin/atom?h=release%2F0.4.0</id>
<link rel='self' href='https://git.cjennings.net/emacs-wttrin/atom?h=release%2F0.4.0'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/'/>
<updated>2026-06-28T10:57:26+00:00</updated>
<entry>
<title>docs: point the geolocation-command docstring at the bundled examples</title>
<updated>2026-06-28T10:57:26+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-28T10:57:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=b1aca874b9a2b5282c0cc83bd4fece981a94e19c'/>
<id>urn:sha1:b1aca874b9a2b5282c0cc83bd4fece981a94e19c</id>
<content type='text'>
C-h v wttrin-geolocation-command now mentions examples/geolocation/, so the
ready-to-adapt scripts are discoverable from inside Emacs, not just the README.
</content>
</entry>
<entry>
<title>chore: clean up package metadata</title>
<updated>2026-06-28T07:45:50+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-28T07:45:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=aeb3f35eee682c489698f17b2286c43cd4921b01'/>
<id>urn:sha1:aeb3f35eee682c489698f17b2286c43cd4921b01</id>
<content type='text'>
Drop the "games" keyword (it miscategorizes a weather tool) from wttrin.el and
Eask. Sync wttrin-geolocation.el's version to 0.3.2 to match the main module.
</content>
</entry>
<entry>
<title>feat: fit and center the weather buffer in its window</title>
<updated>2026-06-28T07:20:12+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-28T07:20:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=e8ea03ecc8c1a2499046b34f785bca4f871531df'/>
<id>urn:sha1:e8ea03ecc8c1a2499046b34f785bca4f871531df</id>
<content type='text'>
Centering and auto-fit share one resize hook (wttrin--update-layout on
window-configuration-change-hook).

Centering is always on. The block centers via the window's left margin,
measured in pixels from the buffer font so it stays exact under a font-height
remap. It centers against the available width including the current margin, so
the margin shrinking the body can't make the value oscillate.

Auto-fit is opt-in (wttrin-auto-fit-font, off by default). When on, the font is
sized so the whole buffer fits top to bottom (down to the row past the footer's
last menu item) without the widest line truncating, clamped to
wttrin-font-height-min and -max.

The pixel-exact measurement needs window-font-width and window-font-height, so
the minimum is now Emacs 25.1.
</content>
</entry>
<entry>
<title>feat: add external-command geolocation, opt-out, and example adapters</title>
<updated>2026-06-25T20:03:18+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-25T20:03:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=7027cccea9eb7170ea0f08e1def3f979f2e59932'/>
<id>urn:sha1:7027cccea9eb7170ea0f08e1def3f979f2e59932</id>
<content type='text'>
These build on the current-location picker with the rest of the geolocation work.

wttrin-geolocation-command runs a command that prints {lat,lng} (and optionally an address) and queries wttr.in by those coordinates. IP geolocation only finds the network's exit point, which is wrong on a VPN or hotspot. A command that scans nearby WiFi resolves to street level. It runs asynchronously, falls back to the IP provider when unset or failing, and assumes nothing about the OS, so it's inert until set. When the command returns an address, wttrin shows it on a "Location:" line, so the resolved place is readable even though the fetch is by raw coordinates.

wttrin-use-current-location is a labeled command that sets the favorite to auto-detect, so the bare t value never has to be typed into init by hand.

wttrin-geolocation-enabled (default t) turns every geolocation surface off for anyone who wants that: the picker entry, the auto-detect favorite, and the command.

examples/geolocation/ ships two reference adapters for the command: google-geolocate.py (Google API, key via the environment or ~/.authinfo.gpg) and apple-wps.py (Apple's keyless WiFi positioning, which uses an undocumented endpoint, so read its caveat). Both are Python 3 standard library and scan via nmcli, with notes on adapting the scan to other systems.
</content>
</entry>
<entry>
<title>feat: add typed error hierarchy for fetch failures</title>
<updated>2026-06-21T12:03:30+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-06-21T12:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=2f469404a4ef8bd0e8cdf776a5d25ba04b63febb'/>
<id>urn:sha1:2f469404a4ef8bd0e8cdf776a5d25ba04b63febb</id>
<content type='text'>
Define a wttrin-error condition with children wttrin-invalid-input, wttrin-network-error, wttrin-not-found-error, wttrin-service-error, and wttrin-parse-error, so callers branch on the class of a failure instead of matching message text.

Synchronous paths signal these directly: a nil query and an unknown geolocation provider now raise wttrin-invalid-input. The async fetch path can't signal across its callback, so it tags the error string with the class via a wttrin-error-type text property. The wttrin-error-message-type accessor reads it back, and two-arg callbacks are untouched.

Retyping the classifier also closed two gaps: a missing status and a 2xx with an empty body used to go silent or get mislabeled "Unexpected HTTP status". Both are now parse errors.

wttrin-geolocation.el now requires wttrin for the shared conditions. It's only ever loaded through wttrin, so the require is a no-op in practice and just makes the dependency explicit.
</content>
</entry>
<entry>
<title>feat: add IP geolocation command for setting wttrin-favorite-location</title>
<updated>2026-04-22T05:07:51+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-22T05:07:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=9958ec4c4396ae8435f7e1818ff383c05df47a14'/>
<id>urn:sha1:9958ec4c4396ae8435f7e1818ff383c05df47a14</id>
<content type='text'>
Lets users set `wttrin-favorite-location` by IP lookup instead of typing a city by hand. `M-x wttrin-set-location-from-geolocation` runs the lookup, shows the detected "City, Region" in a yes/no prompt, and on confirmation sets the variable for the session. The docstring points at `M-x customize-save-variable` for persistence across restarts.

The new `wttrin-geolocation.el` module provides the provider layer. Three providers come built in: ipapi.co (the default), ipinfo.io, and ipwho.is. All three are HTTPS, need no API key, and have free tiers large enough for interactive use. The module has three layers. Pure JSON parsers handle the per-provider quirks: ipapi's `error: true` flag, ipwho.is's `success: false` flag, ipinfo's HTTP-status-only signalling. A small fetch helper extracts the HTTP body. `wttrin-geolocation-detect` wires them together and calls back with "City, Region" on success, or nil on any failure (network error, HTTP 4xx or 5xx, malformed response, rate-limit signal).

Providers live in an alist keyed by symbol, with plist values for :name, :url, and :parser. To use a different provider, push an entry onto `wttrin-geolocation--providers` and select it via `wttrin-geolocation-provider`. No code change needed.

README gains a subsection under Mode-line Weather Display covering the command, how to persist the result, provider selection with free-tier limits, and the accuracy caveat for VPN or mobile-hotspot users.

39 new tests across the parser layer (10 ipapi, 6 ipinfo, 6 ipwhois), fetch-and-dispatch (11), and interactive command (6). Each suite covers Normal, Boundary, and Error categories. Tests mock `url-retrieve` and `yes-or-no-p` at their boundaries and run the real extract-and-parse pipeline underneath. Test suite: 333 → 373 passing.
</content>
</entry>
</feed>
