From da7ee0841924dfbd91c9a944e0bfeff6903bd8a1 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 28 Jun 2026 04:11:45 -0400 Subject: fix: don't steal focus when an async weather response renders wttrin--display-weather ran switch-to-buffer from the async callback, so a response arriving after the user moved to another buffer yanked them back to *wttr.in*. It now renders with set-buffer; selecting the buffer is the interactive command's job (wttrin-query already does it at invocation), so a late response updates the buffer in place without changing the selected window. --- tests/test-wttrin--display-weather.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/test-wttrin--display-weather.el') diff --git a/tests/test-wttrin--display-weather.el b/tests/test-wttrin--display-weather.el index 99ea067..3b9cdee 100644 --- a/tests/test-wttrin--display-weather.el +++ b/tests/test-wttrin--display-weather.el @@ -51,7 +51,10 @@ Weather report: Paris, France ;;; Normal Cases (ert-deftest test-wttrin--display-weather-normal-valid-data-creates-buffer () - "Test that valid weather data creates and displays buffer correctly." + "Test that valid weather data creates and fills the buffer correctly. +Display is the interactive command's job (wttrin-query selects the buffer at +invocation); this async render only updates content, so it does not select a +window." (test-wttrin--display-weather-setup) (unwind-protect (testutil-wttrin-with-clean-weather-buffer @@ -60,9 +63,6 @@ Weather report: Paris, France ;; Buffer should exist (should (get-buffer "*wttr.in*")) - ;; Buffer should be displayed - (should (get-buffer-window "*wttr.in*")) - ;; Buffer should have content (with-current-buffer "*wttr.in*" (should (> (buffer-size) 0)) -- cgit v1.2.3