summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-11-08test: core: enhance ERT tests for pure functionsCraig Jennings
- Enhanced test-wttrin-additional-url-params with clearer test organization - Enhanced test-wttrin--build-url with comprehensive boundary and error cases - Added tests for Unicode, special characters, GPS coordinates, domains - Fixed domain name test to check for URL-encoded @ symbol (%40) - Enhanced test-wttrin--make-cache-key with extensive boundary tests - Critical test: same location with different units produces different keys - Added tests for special chars, Unicode, empty strings, pipe characters All 29 tests for these three pure functions now pass (6 + 12 + 11) Combined with wttrin--fetch-url tests: 38 total tests passing
2025-11-08refactor: fetch: extract duplicate URL fetching logic into wttrin--fetch-urlCraig Jennings
- Created wttrin--fetch-url helper to eliminate code duplication - Refactored wttrin-fetch-raw-string to use helper (27 lines -> 3 lines) - Refactored wttrin--mode-line-fetch-weather to use helper (~30 lines -> ~10 lines) - Added comprehensive ERT test suite with 9 tests covering normal, boundary, and error cases - All tests passing This refactoring provides a single point of truth for async URL fetching, making the code more maintainable and reducing duplication by ~40 lines.
2025-11-04fix(wttrin): Fix ANSI color rendering on fresh Emacs launchCraig Jennings
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
2025-11-04docs: Update vc-install instructions for Wttrin in READMECraig Jennings
Simplify Emacs Lisp configuration using `:vc` keyword for Wttrin installation and update.
2025-11-04feat:docs: Add mode-line weather display featureCraig Jennings
Introduce mode-line weather display in README.org. Add setup, features, and customization instructions, enabling users to show weather updates directly in the mode-line with automatic refresh and interactive options.
2025-11-04feat:wttrin: Add auto-enable option for mode-line weather displayCraig Jennings
Introduce `wttrin-mode-line-auto-enable` customization option. When set to non-nil, this automatically enables the mode-line weather display upon loading wttrin. Users can still manually toggle the display with `wttrin-mode-line-mode`.
2025-11-04refactor:debug: Rename and enhance wttrin debug functionsCraig Jennings
- Reorganized debugging utilities by renaming `debug-wttrin.el` to `wttrin-debug.el` and adding new functions. - The updated module now supports `debug-wttrin-mode-line` for detailed mode-line diagnostics and introduces customizable mode-line weather display with new configuration options. - Additionally, extended debugging capabilities ensure concise emoji-based weather info and tooltip data management, incorporated with auto-loaded conditional debug logic.
2025-11-04refactor:wttrin: Make asynchronous loading standardCraig Jennings
Make asynchronous loading the only mode of operation. It's well tested and doesn't lock up Emacs during fetching. Synchronous loading code has been removed.
2025-11-04docs: Update README with Emacs 29+ note and advanced settingsCraig Jennings
Add a note for Emacs 29+ users about using `setopt` for type checking. Include sections on asynchronous loading and cache settings under advanced settings, providing customization options for Wttrin's behavior.
2025-11-04feat:debug: Add debugging utilities for wttrinCraig Jennings
Introduce debugging features to assist with wttrin display issues. New utility functions enable developers to view raw weather data with line numbers, facilitate easy debugging of header parsing. Includes debug mode toggle functions to save raw weather responses to timestamped files for bug reporting and diagnostics. Updated URL-building tests to confirm correct URL formats with additional 'F' parameter, ensuring comprehensive coverage for various input scenarios.
2025-11-04docs:README: Add VC install instructionsCraig Jennings
Include detailed steps for installing Wttrin using package-vc in Emacs 30 or later.
2025-11-04feat:wttrin-mode: Add major mode for weather displayCraig Jennings
Introduce `wttrin-mode`, a derived major mode for displaying weather information from wttr.in. This includes keybindings for refreshing and querying new locations, and sets up the buffer with a custom font and read-only settings. Existing display logic has been refactored to utilize this mode for improved usability and code organization.
2025-11-04feat(emacs): Add asynchronous weather fetching to wttrinCraig Jennings
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.
2025-11-04feat:Makefile: Add dependency installation targetCraig Jennings
Add a new `install-deps` target to the Makefile for setting up required dependencies, specifically `xterm-color`, using MELPA package repository. Enhance test process by including package initialization in `EMACS_TEST` command.
2025-11-04remove coloring from the MakefileCraig Jennings
2025-11-04feat:Makefile: Add Makefile for build and test automationCraig Jennings
Introduce a Makefile to automate common tasks for the wttrin project. This includes running tests (unit and integration), validating and compiling the main file, linting, and cleaning up generated files.
2025-11-04chore:docs: Remove obsolete documentation filesCraig Jennings
Update .gitignore to include the docs directory.
2025-11-04remove merged bugs.orgCraig Jennings
2025-11-04Add comprehensive ERT test suite and fix critical bugsCraig Jennings
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>
2025-09-25Add caching system for weather dataCraig Jennings
Implement a caching mechanism to reduce API calls and improve performance. The cache stores weather data with configurable TTL (15 minutes default) and automatic cleanup when exceeding max entries (50 default). - Add cache configuration options for TTL and max entries - Store fetched data with timestamps in hash table - Add force refresh functionality with 'r' key binding - Implement automatic cache cleanup to prevent unbounded growth - Fall back to stale cache on network errors - Also, fixed URL parameter concatenation in fetch function
2025-09-24use https rather than httpCraig Jennings
2025-09-24don't mutate url-request-extra-headersCraig Jennings
- bind it locally instead within the let form
2025-09-24ensure utf-8 encodingCraig Jennings
2024-04-22wordsmithingCraig Jennings
- fix numbering mistake - swap package installation ordering - word tweaking, probably born out of procrastination
2024-04-22wordsmithingCraig Jennings
2024-04-22changed accept-language variable name to wttrin-default-languagesCraig Jennings
the unwieldly wttrin-default-accept-language became the lighter-weight and more user-friendly wttrin-default-language
2024-04-22Readme RewriteCraig Jennings
- moved the format from markdown to org - much better text IMHO - badges and sections and pictures oh my!
2024-04-21clean-up byte compile and licensing issuesCraig Jennings
- fix let-binding for date-time-stamp and location-info - also switched goto-line usage (interactive only) with forward-line - require face-remap for buffer-face-mode-face - adjust all code and docstring for 80 column width
2024-04-21fix docstring longer than 80 charactersCraig Jennings
2024-04-21Add License Boilerplate and SPDX-License-Identifier for GPL 3.0Craig Jennings
2024-04-11fit and finish bugfixingCraig Jennings
- adjust display header to location and date - change references from cities to location - update default-location names requery smoothly - always name the buffer *wttr.in* for easy reuse/killing - keep the buffer display up while user chooses next location
2024-04-01package prep: linter bugfixing and updated readmeCraig Jennings
- added manual and straight installation instructions - corrected font-height setting example - corrected :type for wttrin-default-accept-language - fix docstrings corrected emacs-lisp code block, upcased usage header
2024-04-01squash! Update README.mdCraig Jennings
2024-04-01bugfixesCraig Jennings
- fixed types for default-accept-language and default-cities - removed unneeded status variable in wttrin-fetch-raw-string - syntax correction in defgroup wttrin description - changed default font to Lucida Console (more universal + compatible with wttr.in) - added games to keywords per package linter - updated version, header description, and commentary
2024-04-01Update README.mdCraig Jennings
attempted code block and image link fix
2024-04-01customize font, display date, clean requeries, license change, &c.Craig Jennings
- changed license to GPLv3 - allow user to specify font name and height for display - place date/time stamp above location name at top of buffer - re-query with new location deletes to reduce buffer clutter - updated screenshot to show current updates - changed references from "city" to "location" in wttrin.el - removed old CI config files - removed old badges from readme file
2024-03-11removing fake run-travis-ci.shCraig Jennings
2024-03-11Reapplying patch to avoid raw HTML; other changesCraig Jennings
Other changes being: - added text prompt for quitting and selecting another city - updated default cities - fixed docstring issues reported by Emacs' linter - updated several prompt texts - updated maintainer
2021-08-25applying outstanding patchesCraig Jennings
This fork has the following patches applied (still outstanding in bcbcarl/emacs-wttrin): - patch for selecting the unit system: https://github.com/bcbcarl/emacs-wttrin/pull/10 - patch for url request to return ascii rather than html https://github.com/bcbcarl/emacs-wttrin/pull/18 - patch to use https instead of http: https://github.com/bcbcarl/emacs-wttrin/pull/15
2021-08-23Added user.agent fix to correct color display, also using httpsCraig Jennings
2017-06-14Merge pull request #9 from davep/masterCarl X. Su
Small improvements to passing city to wttrin
2017-06-12Default the city name if only one city is defined.Dave Pearson
If wttrin-default-cities only has the one city in it, default the input to wttrin to that so that it's easier and faster to get the weather.
2017-06-12Allow wttrin to be called with a city as an argumentDave Pearson
This means it can be easily called from other code, with the city passed as an argument.
2017-03-23Support Accept-Language headerCarl X. Su
2017-03-23Merge pull request #8 from emacsist/masterCarl X. Su
[add] HTTP request header: Accept-Language, display different lan…
2017-03-22[add] add HTTP request header: Accept-Language, display different language.emacsist
2016-04-26Fix Travis-CI build script permissionCarl X. Su
2016-04-26Add Travis-CI build status badgeCarl X. Su
2016-04-26Add first Travis-CI configCarl X. Su
2016-04-14Merge pull request #6 from pashky/masterCarl X. Su
Added local keymap