<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs-wttrin/wttrin-debug.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: clean byte-compilation warnings</title>
<updated>2026-04-04T19:14:39+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T19:14:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=88a66244fd613662ee7d5d3a0ad4394cfafdb521'/>
<id>urn:sha1:88a66244fd613662ee7d5d3a0ad4394cfafdb521</id>
<content type='text'>
Move define-obsolete-variable-alias before its referent defcustom to
fix "alias should be declared before its referent" warning. Add
defvar for wttrin--force-refresh in wttrin-debug.el so the
byte-compiler knows the dynamic variable is intentional.
</content>
</entry>
<entry>
<title>doc: improve source comments for senior developer audience</title>
<updated>2026-04-04T18:38:57+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T18:38:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=8f89387201ed0cc7ddc5a758079a52a2ce12fe68'/>
<id>urn:sha1:8f89387201ed0cc7ddc5a758079a52a2ce12fe68</id>
<content type='text'>
Remove obvious comments that restate what the code does ("save debug
data if enabled", "temporarily allow editing", "align buffer to top").
Add comments explaining non-obvious decisions: why risky-local-variable
is needed, why user-agent is curl, what wttr.in format codes mean,
what the emoji extraction regex matches, and why after-init-time
matters. Fix stale docstrings that no longer match the no-op stub
pattern.
</content>
</entry>
<entry>
<title>fix: debug-wttrin-show-raw serves cached data instead of fetching</title>
<updated>2026-04-04T18:27:39+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T18:27:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=0bbed459fb60f1b9ebe0e137527aa44b75c4835e'/>
<id>urn:sha1:0bbed459fb60f1b9ebe0e137527aa44b75c4835e</id>
<content type='text'>
A debug command should show what the API currently returns, not a
cached copy. Bind wttrin--force-refresh to t so the fetch always
bypasses the cache.
</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>fix: debug-wttrin-show-raw broken by async API change</title>
<updated>2026-04-04T17:34:34+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-04-04T17:34:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=f33d7231fa7f9f11250a592e28601df6b8f564c7'/>
<id>urn:sha1:f33d7231fa7f9f11250a592e28601df6b8f564c7</id>
<content type='text'>
debug-wttrin-show-raw called wttrin--get-cached-or-fetch with 1 arg,
but the function now requires 2 (location + callback) since the async
refactor. Rewrote to use the callback pattern. Also handles nil
response gracefully.
</content>
</entry>
<entry>
<title>refactor: debug: route all debug output to debug log instead of Messages</title>
<updated>2025-11-08T22:58:14+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-08T22:58:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=c47f1d42abbb25af583384a3cb0ca17e8bcd61df'/>
<id>urn:sha1:c47f1d42abbb25af583384a3cb0ca17e8bcd61df</id>
<content type='text'>
- Remove (message ...) call from wttrin--debug-log function
- Replace 9 debug message calls in wttrin.el with wttrin--debug-log
- All debug output now goes to debug log for review with M-x wttrin-debug-show-log
- User-facing error messages preserved (network errors, processing errors)
- Updated docstring to clarify messages are stored for later review
</content>
</entry>
<entry>
<title>refactor: Improve cache cleanup clarity and add input validation</title>
<updated>2025-11-08T19:20:18+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-08T19:16:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=b6761ed66012fcf3e98aa252582aaf03b2b85c12'/>
<id>urn:sha1:b6761ed66012fcf3e98aa252582aaf03b2b85c12</id>
<content type='text'>
Cache Refactorings:
- Extract wttrin--get-cache-entries-by-age helper function
- Refactor wttrin--cleanup-cache-if-needed to use helper
- Improves code clarity with descriptive variable names
- Makes cache logic independently testable
- Add 15 new tests (8 for helper, 7 for refactored cleanup)

Input Validation:
- Add range validation to wttrin-mode-line-startup-delay (1-10 seconds)
- Prevents invalid values (0, negative, or excessive delays)
- Uses restricted-sexp type for enforcement

Test Fixes:
- Fix debug function naming (use public wttrin-debug-clear-log)
- Ensure wttrin-debug module loads in test setup
- Make mocks synchronous for batch mode compatibility
- Update test expectations to match actual debug messages
- Fix startup delay test to check defcustom default value

Linter/Compiler Fixes:
- Add declare-function for wttrin--debug-log
- Add defvar/declare-function in wttrin-debug.el
- Fix docstring line lengths (wrap at 80 chars)
- Fix checkdoc warnings (imperative mood, escaping)
- Disambiguate temporary-file-directory reference

All 165 tests passing. Clean byte-compile, package-lint, checkdoc.
</content>
</entry>
<entry>
<title>refactor: make debug functions public (single hyphen naming)</title>
<updated>2025-11-08T18:12:52+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-08T18:12:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=04b11059b831c94b4e5ba901b735fcc888cbbe1a'/>
<id>urn:sha1:04b11059b831c94b4e5ba901b735fcc888cbbe1a</id>
<content type='text'>
Renamed private debug functions to public API:
- wttrin--debug-show-log → wttrin-debug-show-log
- wttrin--debug-clear-log → wttrin-debug-clear-log

Added ;;;###autoload to both functions for proper autoloading.

Updated all references:
- README.org (2 occurrences)
- tests/README-DEBUG-TESTS.md (4 occurrences)
- tests/test-wttrin-integration-with-debug.el (8 occurrences)

These are user-facing commands that should be discoverable via M-x,
so they follow the public API naming convention (single hyphen).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: debug: add comprehensive debug logging and integration tests</title>
<updated>2025-11-08T17:53:02+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-08T17:53:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/emacs-wttrin/commit/?id=1f40ef408641680c951a65b72be240d9b7729d8e'/>
<id>urn:sha1:1f40ef408641680c951a65b72be240d9b7729d8e</id>
<content type='text'>
Enhanced wttrin-debug.el:
- Added wttrin--debug-log() function for timestamped logging
- Added wttrin--debug-clear-log() to clear log
- Added wttrin--debug-show-log() to display log in buffer
- Debug log structure: list of (timestamp . message) pairs

Added debug logging to key functions in wttrin.el:
- wttrin--fetch-url: Logs start, success (bytes), and errors
- wttrin--mode-line-fetch-weather: Logs start, URL, data received
- wttrin--mode-line-update-display: Logs display update, emoji extraction

Created comprehensive integration tests:
- test-wttrin-integration-with-debug.el (5 tests, 3 passing)
- Tests fetch, mode-line display, error handling with debug logging
- Includes mocked network calls to avoid external dependencies
- Example debug output shows complete flow:
  [wttrin-debug 11:51:46.490] mode-line-fetch: Starting fetch for Berkeley, CA
  [wttrin-debug 11:51:46.490] mode-line-fetch: Received data = "Berkeley, CA: ☀️ +62°F Clear"
  [wttrin-debug 11:51:46.490] mode-line-display: Extracted emoji = "☀", font = Noto Color Emoji
  [wttrin-debug 11:51:46.490] mode-line-display: Complete. mode-line-string set = YES

Added test fixtures:
- tests/fixtures/test-init.el: Minimal config with debug enabled
- tests/README-DEBUG-TESTS.md: Documentation for using debug features

Usage:
  (setq wttrin-debug t)  ; Before loading wttrin
  (require 'wttrin)
  M-x wttrin--debug-show-log  ; View all logged events

This provides complete visibility into wttrin's operation for troubleshooting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
