From 7673e72ed4dc4af9c3db9a5962c4673bd1ce90e3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 4 Nov 2025 19:21:34 -0600 Subject: fix(wttrin): Fix ANSI color rendering on fresh Emacs launch 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 --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 244c16f..4faeccc 100644 --- a/README.org +++ b/README.org @@ -88,7 +88,7 @@ Simply use the keybinding you assigned, or run `M-x wttrin` to display the weath [[assets/location-menu.png]] -Choose one, or for a quick one-time weather check, type a new location and ⏎ . After the weather is displayed, you can press `g` to check another location or `q` to exit, just like it says in the buffer. +Choose one, or for a quick one-time weather check, type a new location and ⏎ . After the weather is displayed, you can press `a` to check another location, `g` to refresh, or `q` to quit. ** Customization Wttrin can be customized using the built-in Emacs Customize interface. To do this, type M-x customize ⏎ wttrin ⏎ and use the UI. However, it's more portable and reproducible to keep the customizations in your init file, so do that. -- cgit v1.2.3