emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/gptel f0b18c5f8b 113/273: gptel-transient: Exit gptel-syst


From: ELPA Syncer
Subject: [nongnu] elpa/gptel f0b18c5f8b 113/273: gptel-transient: Exit gptel-system-prompt after selection (#96)
Date: Wed, 1 May 2024 10:02:10 -0400 (EDT)

branch: elpa/gptel
commit f0b18c5f8bad3fb67f8e2c40b97ad0104aded723
Author: Tianshu Wang <wang@tianshu.me>
Commit: GitHub <noreply@github.com>

    gptel-transient: Exit gptel-system-prompt after selection (#96)
    
    gptel-transient.el (gptel-menu, gptel-system-prompt--setup): Exit
    the system prompt interface when picking a prompt. This saves the
    user a `C-g`.
---
 gptel-transient.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gptel-transient.el b/gptel-transient.el
index 7a3daa622d..ece143b097 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -114,7 +114,7 @@ which see."
    (lambda () (format "Directive:  %s"
                  (truncate-string-to-width
                   gptel--system-message (max (- (window-width) 14) 20) nil nil 
t)))
-   ("h" "Set directives for chat" gptel-system-prompt)]
+   ("h" "Set directives for chat" gptel-system-prompt :transient t)]
   [["Session Parameters"
     (gptel--infix-max-tokens)
     (gptel--infix-num-messages-to-send)
@@ -173,15 +173,14 @@ which see."
        collect (list (key-description key) (capitalize name)
                 `(lambda () (interactive)
                   (message "Directive: %s" ,prompt)
-                  (setq gptel--system-message ,prompt))
-                :transient t)
+                  (setq gptel--system-message ,prompt)))
        into prompt-suffixes
        finally return
        (nconc
         (list (list 'gptel--suffix-system-message))
         prompt-suffixes
         (list (list "SPC" "Pick crowdsourced prompt"
-                    'gptel--read-crowdsourced-prompt))))))
+                    'gptel--read-crowdsourced-prompt :transient nil))))))
 
 (transient-define-prefix gptel-system-prompt ()
   "Change the system prompt to send ChatGPT.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]