diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-08 23:46:58 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-08 23:46:58 -0600 |
| commit | c65a67efb7844797761896d77e02c0e883e2a54a (patch) | |
| tree | 82b2f6584b37632862387d327215578b1e8f603c /tests | |
| parent | 9074bf41fedbabfeb0e9c0bb7c3427e069bfeaab (diff) | |
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)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-wttrin-smoke.el | 4 |
1 files changed, 2 insertions, 2 deletions
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)." |
