<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-ai-config-gptel-magit-lazy-loading.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-16T06:31:36+00:00</updated>
<entry>
<title>fix(ai-config): hook gptel-magit wiring per-feature, not on magit</title>
<updated>2026-05-16T06:31:36+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-16T06:31:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=1ca46c2b477afd014ef993ed0ca5ca50e257adce'/>
<id>urn:sha1:1ca46c2b477afd014ef993ed0ca5ca50e257adce</id>
<content type='text'>
The wiring keyed on `with-eval-after-load 'magit` fires while two
of its three references are still undefined.  `magit.el` calls
`(provide 'magit)` BEFORE its `cl-eval-when (load eval)` block
requires `magit-commit` and `magit-stash`.  At that moment the
`magit-commit` transient prefix doesn't exist, and
`transient-append-suffix` silently no-ops on missing prefixes
(default `transient-error-on-insert-failure` is nil).  The "g
Generate commit" and "x Explain" suffixes never landed.  Only the
M-g binding worked, because `git-commit` IS required before
provide.

Three per-feature hooks replace the single `'magit` hook: one each
on `git-commit`, `magit-commit`, and `magit-diff`.  Each hooks the
exact dependency the wiring needs, side-stepping the load-order
race entirely.

The companion test was rewritten to check `after-load-alist`
registration rather than drive the hooks through `provide`.  Emacs
30 batch mode doesn't fire registered `eval-after-load` callbacks
on `provide` alone -- only an actual `load` does.  Inspecting the
registration is the stronger guard anyway: the regression is "a
single `'magit` hook," and the right shape of that check is "no
entry under `magit`, entries under `git-commit`, `magit-commit`,
`magit-diff`."
</content>
</entry>
<entry>
<title>fix(ai-config): Ensure gptel-magit is installed via use-package</title>
<updated>2026-05-16T04:48:20+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-16T04:48:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=3b4c8d8915d469b0bfbb148820bca7a31dcd734a'/>
<id>urn:sha1:3b4c8d8915d469b0bfbb148820bca7a31dcd734a</id>
<content type='text'>
Replace raw autoload calls with a `use-package` declaration so
`use-package-always-ensure` installs gptel-magit on machines that
haven't run `package-install`, fixing the "Cannot open load file"
error on transient setup.
</content>
</entry>
<entry>
<title>refactor(gptel): lazy-load gptel-magit, rebind rewrite/context keys</title>
<updated>2026-03-07T03:15:31+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-03-07T03:15:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=2faf32bcc5107312e6f9066489fb93e41e5fbaa8'/>
<id>urn:sha1:2faf32bcc5107312e6f9066489fb93e41e5fbaa8</id>
<content type='text'>
- Replace use-package gptel-magit hook with autoloads via
  with-eval-after-load 'magit (loads gptel only on key press)
- Move org header defuns above use-package to fix load order
- Set gptel-include-reasoning to "*AI-Reasoning*" buffer
- Rebind rewrite to C-; a r, clear context to C-; a c
- Add test-ai-config-gptel-magit-lazy-loading.el (8 tests)
- Mark all ai-config cleanup items DONE in todo.org
</content>
</entry>
</feed>
