From 00060c73fbfae541323e0c415784e56e22c9a0bf Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Tue, 26 Dec 2023 10:22:47 -0800 Subject: [PATCH] gptel-transient: Exit transient when writing directive * gptel-transient.el (gptel--suffix-system-message): Explicitly set the :transient slot of the system-message editor commands to `transient--do-exit` (#157). --- gptel-transient.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gptel-transient.el b/gptel-transient.el index 6eecd3e5..6bb91f97 100644 --- a/gptel-transient.el +++ b/gptel-transient.el @@ -188,7 +188,10 @@ which see." prompt-suffixes (list (list "SPC" "Pick crowdsourced prompt" 'gptel--read-crowdsourced-prompt - :transient nil)))))) + ;; NOTE: Quitting the completing read when picking a + ;; crowdsourced prompt will cause the transient to exit + ;; instead of returning to the system prompt menu. + :transient 'transient--do-exit)))))) (transient-define-prefix gptel-system-prompt () "Change the system prompt to send ChatGPT. @@ -522,7 +525,7 @@ This uses the prompts in the variable (transient-define-suffix gptel--suffix-system-message () "Set directives sent to ChatGPT." - :transient nil + :transient 'transient--do-exit :description "Set custom directives" :key "h" (interactive)