diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-16 00:31:58 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-16 00:31:58 -0500 |
| commit | 6a3e93ec83e4e87a0cd85fc0874758a3088eccbf (patch) | |
| tree | 5443afccb385e9680a35bf7ee65563167f6c344e /scripts | |
| parent | bac4c142a8a40906fcd982c94cc0888e2b9aa008 (diff) | |
| download | dotemacs-6a3e93ec83e4e87a0cd85fc0874758a3088eccbf.tar.gz dotemacs-6a3e93ec83e4e87a0cd85fc0874758a3088eccbf.zip | |
fix(ai-config): force tab-width=8 in gptel org-mode prompt buffers
gptel's `gptel--with-buffer-copy-internal` copies the source buffer's `major-mode` symbol but doesn't run mode hooks. An inherited-org-mode prompt buffer keeps `tab-width` at this config's global default of 4 instead of the 8 that `org-mode-hook` would set. When gptel later parses the prompt buffer with `org-element`, Org's `tab-width=8` guard raises "Tab width in Org files must be 8, not 4."
I was hitting this on every second `gptel-magit-generate-message` from COMMIT_EDITMSG. `vc-config.el` sets `git-commit-major-mode 'org-mode'`, and the diffs contained list-shaped content that `org-element--list-struct` parsed.
The advice forces `tab-width=8` in the prompt buffer when its inherited mode is org-mode. It's a local workaround for an upstream gap. An upstream patch to run `(delay-mode-hooks (funcall major-mode))` in the buffer-copy is the real fix. I'll send it next.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
