Problem
my-codex-enable-prompt-preview is currently global: users either preview every prompt or none of them.
That is coarse. Preview is most useful for expensive, unusual, or high-risk prompts, while routine prompts are better sent directly.
Proposal
Add a universal one-shot preview override for F8 prompt commands:
F8 <command>: use the configured my-codex-enable-prompt-preview behaviour;
C-u F8 <command>: invert that behaviour for this prompt only.
Examples:
- If
my-codex-enable-prompt-preview is nil, C-u F8 s previews the selected-region prompt before sending.
- If
my-codex-enable-prompt-preview is t, C-u F8 s sends directly for this invocation.
Rationale
C-u is idiomatic Emacs for a one-off command variation. It avoids adding duplicate preview commands or spending extra F8 keyspace, while keeping the global option useful as the default behaviour.
Implementation note
Because F8 opens a transient menu, the prefix argument may be received by my-codex-transient-preserve-selection / my-codex-transient rather than by the final suffix command.
So this likely needs deliberate plumbing:
- Capture whether
C-u was used when opening the F8 transient.
- Store it as a one-shot prompt-preview override.
- Have
my-codex--preview-and-send-prompt consult that override and invert my-codex-enable-prompt-preview for the current prompt only.
- Clear the override after use.
Documentation
Document this as “invert prompt preview for this command” rather than “preview this prompt”, since users with preview enabled globally would get direct send for the one invocation.
Problem
my-codex-enable-prompt-previewis currently global: users either preview every prompt or none of them.That is coarse. Preview is most useful for expensive, unusual, or high-risk prompts, while routine prompts are better sent directly.
Proposal
Add a universal one-shot preview override for F8 prompt commands:
F8 <command>: use the configuredmy-codex-enable-prompt-previewbehaviour;C-u F8 <command>: invert that behaviour for this prompt only.Examples:
my-codex-enable-prompt-previewisnil,C-u F8 spreviews the selected-region prompt before sending.my-codex-enable-prompt-previewist,C-u F8 ssends directly for this invocation.Rationale
C-uis idiomatic Emacs for a one-off command variation. It avoids adding duplicate preview commands or spending extra F8 keyspace, while keeping the global option useful as the default behaviour.Implementation note
Because
F8opens a transient menu, the prefix argument may be received bymy-codex-transient-preserve-selection/my-codex-transientrather than by the final suffix command.So this likely needs deliberate plumbing:
C-uwas used when opening the F8 transient.my-codex--preview-and-send-promptconsult that override and invertmy-codex-enable-prompt-previewfor the current prompt only.Documentation
Document this as “invert prompt preview for this command” rather than “preview this prompt”, since users with preview enabled globally would get direct send for the one invocation.