aboutsummaryrefslogtreecommitdiff
path: root/modules/ai-vterm.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-15 02:21:57 -0500
committerCraig Jennings <c@cjennings.net>2026-05-15 02:21:57 -0500
commitf47ac3625aa42b0ba531e540e8b2be7b46ecc85b (patch)
treee5dc681450ba43e62af37e7c8ed322e72a3205fb /modules/ai-vterm.el
parentcba8cc00cb8553650fb9176b8843d2c64e8064b5 (diff)
downloaddotemacs-f47ac3625aa42b0ba531e540e8b2be7b46ecc85b.tar.gz
dotemacs-f47ac3625aa42b0ba531e540e8b2be7b46ecc85b.zip
fix(ai-vterm): autoload cj/toggle-gptel to silence cross-module warning
make compile warned that cj/toggle-gptel is not known to be defined when ai-vterm.el is byte-compiled. The M-F9 binding still worked during normal startup because init.el loads ai-config.el after ai-vterm.el, but the dependency was implicit -- byte-compile saw the function symbol unresolved, and loading ai-vterm.el in isolation left M-F9 bound to an undefined function. Declare cj/toggle-gptel as an interactive autoload pointing at ai-config. This silences the warning, keeps ai-vterm.el free of a load-time (require 'ai-config), and makes the load-order contract explicit: the binding works as long as ai-config eventually loads. Test asserts that requiring ai-vterm in isolation leaves cj/toggle-gptel fboundp as an autoload sigil (not a real function). A regression that adds (require 'ai-config) at the top of ai-vterm.el would flip this, and a regression that drops the autoload form would leave fboundp nil.
Diffstat (limited to 'modules/ai-vterm.el')
-rw-r--r--modules/ai-vterm.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/ai-vterm.el b/modules/ai-vterm.el
index 108a73ca7..18320eeeb 100644
--- a/modules/ai-vterm.el
+++ b/modules/ai-vterm.el
@@ -53,6 +53,12 @@
(declare-function vterm-send-return "vterm" ())
(defvar vterm-mode-map)
+;; `cj/toggle-gptel' lives in ai-config.el. Declaring it as an interactive
+;; autoload (rather than `require'ing ai-config here) silences the byte-compile
+;; warning at line 685/696 while keeping ai-vterm.el free of a load-time
+;; dependency on the full ai-config stack.
+(autoload 'cj/toggle-gptel "ai-config" nil t)
+
(defgroup ai-vterm nil
"In-Emacs AI-agent launcher with vertical-split vterm."
:group 'tools)