From c65a67efb7844797761896d77e02c0e883e2a54a Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 8 Nov 2025 23:46:58 -0600 Subject: refactor: core: lazy-load xterm-color dependency Move xterm-color from top-level require to on-demand loading within functions that actually use it. This simplifies user configuration by eliminating the need for separate xterm-color use-package declarations. Changes: - Replace top-level (require 'xterm-color) with declare-function - Add (require 'xterm-color) in wttrin--process-weather-content - Add (require 'xterm-color) in wttrin--display-weather - Update smoke test to check loadability vs. feature presence Benefits: - Simpler use-package config (no :after xterm-color needed) - xterm-color still auto-installed via Package-Requires on MELPA - Load time optimization (loads only when displaying weather) --- tests/test-wttrin-smoke.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-wttrin-smoke.el b/tests/test-wttrin-smoke.el index 5cb4b08..acf7fd5 100644 --- a/tests/test-wttrin-smoke.el +++ b/tests/test-wttrin-smoke.el @@ -33,9 +33,9 @@ If we got here, the package loaded successfully via (require 'wttrin)." ;;; Dependency Tests (ert-deftest test-wttrin-smoke-xterm-color-available () - "Test that xterm-color dependency is available. + "Test that xterm-color dependency can be loaded when needed. This is a REQUIRED dependency - wttrin cannot function without it." - (should (featurep 'xterm-color))) + (should (require 'xterm-color nil t))) (ert-deftest test-wttrin-smoke-url-available () "Test that url library is available (built-in)." -- cgit v1.2.3