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 | 03d7c6738835e985319d84b67f582c5a75223a2d (patch) | |
| tree | c9c12ec77555ab68b90f128a5801a17ffa1d2a4d /modules/system-defaults.el | |
| parent | f33315dafdf30e9bd5727b77a0af8797e9d0ea76 (diff) | |
| download | dotemacs-03d7c6738835e985319d84b67f582c5a75223a2d.tar.gz dotemacs-03d7c6738835e985319d84b67f582c5a75223a2d.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 'modules/system-defaults.el')
0 files changed, 0 insertions, 0 deletions
