From b3d41f9a0c63b13ad497a48677de933a3fb5a5cf Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 18 May 2026 02:24:30 -0400 Subject: refactor(ai-config): switch gptel to local fork, drop tab-width advice I switched the gptel use-package form to `:load-path "~/code/gptel"` with `:ensure nil` so Emacs loads from the fork instead of the MELPA release. The fork now carries the narrow `tab-width' copy in `gptel-org--create-prompt' that karthink redirected the upstream PR to, which replaces the local `:around' advice on `gptel--with-buffer-copy-internal' I'd been carrying. I also dropped the stale test file `tests/test-ai-config-gptel-prompt-tab-width.el' and the matching stub in `tests/testutil-ai-config.el'. Both existed only to test the advice I removed. --- tests/testutil-ai-config.el | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'tests/testutil-ai-config.el') diff --git a/tests/testutil-ai-config.el b/tests/testutil-ai-config.el index f56a38e15..c74862226 100644 --- a/tests/testutil-ai-config.el +++ b/tests/testutil-ai-config.el @@ -74,21 +74,6 @@ ;; so the magit integration only activates when magit is provided. ;; See test-ai-config-gptel-magit-lazy-loading.el for magit stub tests. -;; Stub `gptel--with-buffer-copy-internal' so the advice attached to it -;; in ai-config.el can be exercised without loading real gptel-request. -;; Mirrors the salient bits of the real function (gptel-request.el:945): -;; create a temp buffer, copy major-mode as a symbol (no hooks), call -;; body-thunk inside. See test-ai-config-gptel-prompt-tab-width.el. -(unless (fboundp 'gptel--with-buffer-copy-internal) - (defun gptel--with-buffer-copy-internal (buf _start _end body-thunk) - "Stub: create temp buffer, copy major-mode from BUF, run BODY-THUNK." - (let ((temp (generate-new-buffer " *gptel-prompt-stub*" t))) - (unwind-protect - (with-current-buffer temp - (setq major-mode (buffer-local-value 'major-mode buf)) - (funcall body-thunk)) - (kill-buffer temp))))) - ;; Stub ai-conversations (provide 'ai-conversations) -- cgit v1.2.3