| Age | Commit message (Collapse) | Author |
|
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
|
|
Introduce asynchronous data fetching to the wttrin.el Emacs package.
This enhancement avoids blocking Emacs during data retrieval by
using `url-retrieve` for async calls. The behavior is controlled via
a new customizable variable `wttrin-use-async`. Tests have been
added for the new async behavior to ensure proper functionality.feat:makefile): Add package initialization for Emacs batch
Enhance Makefile with package support by loading and initializing
MELPA archive before validating and compiling, ensuring required
packages are available during these operations.
feat(tests): Add unit tests for `wttrin--display-weather`
Introduce comprehensive tests for `wttrin--display-weather` function
to validate buffer creation, content, keybindings, and error
handling.
|
|
Session 1: Testing infrastructure and initial test coverage
Bug fixes in wttrin.el:
- Fix wttrin-additional-url-params to handle nil unit system
- Remove incorrect callback parameter to url-retrieve-synchronously
- Add nil buffer check for network failures
- Strip HTTP headers before decoding response
- Kill buffer after fetch to prevent memory leaks
- Fix double concatenation of URL params in cache function
- Add proper URL encoding via new wttrin--build-url function
Refactoring:
- Extract wttrin--build-url as pure, testable function
- Separate URL building logic from network I/O
Test infrastructure (33 tests, 100% passing):
- tests/testutil-wttrin.el: Shared test utilities
- tests/test-wttrin-additional-url-params.el: 7 tests
- tests/test-wttrin--make-cache-key.el: 9 tests
- tests/test-wttrin--build-url.el: 10 tests
- tests/test-wttrin--cleanup-cache-if-needed.el: 7 tests
Documentation:
- docs/testing-plan.org: Comprehensive testing roadmap
- docs/bugs.org: Bug analysis from code review
- docs/NOTES.org: Session tracking and guidelines
- docs/session-1-summary.org: Detailed session summary
Next session: Cache workflow tests, parsing logic extraction, integration tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|