<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-ai-quick-ask.el, branch load-graph-classify-start</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-start</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-start'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-16T06:48:59+00:00</updated>
<entry>
<title>feat(ai-quick-ask): add cj/gptel-quick-ask one-shot command</title>
<updated>2026-05-16T06:48:59+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-16T06:48:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=670117cccdbae4706dfaa5e05144c256c3a657f0'/>
<id>urn:sha1:670117cccdbae4706dfaa5e05144c256c3a657f0</id>
<content type='text'>
New module `modules/ai-quick-ask.el`.  Bound to `C-; a q` via
`cj/ai-keymap` ("quick ask").

`cj/gptel-quick-ask` reads a prompt in the minibuffer, creates a
transient `*GPTel-Quick*` buffer in `cj/gptel-quick-mode` (a
special-mode derivative with `q` / `escape` / `c` bindings), inserts
"Q: &lt;prompt&gt;" plus a response marker, then calls `gptel-request`
with `:stream t` so the answer streams into the buffer.  Doesn't
touch `*AI-Assistant*`, doesn't autosave.

Two follow-up commands work in the buffer:

- `cj/gptel-quick-dismiss` (`q` / `escape`): delete the window and
  kill the buffer.  Idempotent when the buffer is absent.
- `cj/gptel-quick-continue` (`c`): extract the prompt + response,
  seed them into `*AI-Assistant*` under proper org headings (matching
  the `cj/gptel--fresh-org-prefix` shape), display the side window,
  then dismiss the quick buffer.

13 tests cover the pure helpers (initial-text shape, response
extraction across normal / multi-line / no-marker / empty inputs,
seed-text shape), the ask path (buffer created in right mode,
prompt recorded, gptel-request called, empty-prompt error), the
dismiss path (kills buffer / no-op when absent), and the continue
path (seeds `*AI-Assistant*`, dismisses quick buffer, errors
outside a quick buffer).  `gptel-request` is stubbed in tests so
nothing hits the network.
</content>
</entry>
</feed>
