From a8c7e8bf822535470d1a4621030b0edd07aaccb4 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 16 May 2026 01:42:30 -0500 Subject: feat(ai-conversations): add cj/gptel-autosave-toggle with [AS] mode-line indicator `cj/gptel-autosave-enabled` flipped to t inside the save/load entry points with no way back off short of editing the variable or clearing the buffer, and no visible indicator that it was on. Two pieces: - `cj/gptel-autosave-toggle` flips the buffer-local state in the current GPTel buffer. Bound to `C-; a A` via `cj/ai-keymap` (which-key: "toggle autosave"). When autosave is OFF and no filepath is configured yet, the command prompts to save the conversation first so a save target exists; otherwise it just flips the bit. - `cj/gptel-autosave-mode-line-format` surfaces " [AS]" in the mode-line when autosave is on, blank when off. Installed via a `gptel-mode-hook` so every GPTel buffer picks it up. The install helper is idempotent. 6 new tests cover enable/disable paths, the no-filepath prompt path, the not-a-gptel-buffer error path, the mode-line format evaluation, and the install idempotence. --- todo.org | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'todo.org') diff --git a/todo.org b/todo.org index c0a9fa0e3..face1e4cf 100644 --- a/todo.org +++ b/todo.org @@ -2712,12 +2712,24 @@ UX (decided 2026-05-15): - A second key (suggested: =c= for "continue") escalates the one-shot into a full conversation: creates a new gptel conversation seeded with the quick-ask prompt + response, then opens it in the normal =*AI-Assistant*= side window. After the escalation the =*GPTel-Quick*= buffer can be dismissed. - Stream the response into the temp buffer (gptel's default behavior) -- minibuffer echo is awkward for anything past a single line. -*** TODO [#C] Autosave toggle command + indicator :feature: - -=cj/gptel-autosave-enabled= flips to =t= inside the save/load entry points. There's no command to flip it back off without manually setting the var or clearing the buffer, and no visible indicator that autosave is on. - -- Add =cj/gptel-autosave-toggle= bound under =C-; a A=. -- Surface autosave state in the mode-line of the =*AI-Assistant*= buffer (a small =[AS]= when on, blank when off). +*** 2026-05-16 Sat @ 01:41:51 -0500 Added cj/gptel-autosave-toggle + [AS] mode-line indicator + +=cj/gptel-autosave-toggle= flips =cj/gptel-autosave-enabled= in the +current GPTel buffer. Bound to =C-; a A= via =cj/ai-keymap= +(which-key labelled "toggle autosave"). When autosave is OFF and no +filepath is configured, the command prompts to save the conversation +first so a save target exists. When autosave is ON, the command +turns it off. + +=cj/gptel-autosave-mode-line-format= surfaces " [AS]" in the +mode-line when autosave is on, blank when off. Installed via a +=gptel-mode-hook= so every GPTel buffer picks it up. The install +helper is idempotent. + +6 new tests in =tests/test-ai-conversations.el= cover the enable / +disable paths, the no-filepath prompt path, the +not-a-gptel-buffer error path, the mode-line format evaluation, and +the install idempotence. ** TODO [#C] Extend F2 "preview" convention across modes :feature: -- cgit v1.2.3