branch: elpa/gptel
commit 8b9114d72088a3a3cfec825f00b76ad82e4d617e
Author: Karthik Chikmagalur <[email protected]>
Commit: Karthik Chikmagalur <[email protected]>

    gptel-transient: Update for Transient 1.12 behavior
    
    * gptel-transient.el (gptel-system-prompt--format): Transient
    1.12+ passes the suffix object to the object description method if
    the description function accepts an argument.  (Previously
    Transient performed a more sophisticated arity check.)
    
    `gptel-system-prompt--format' previously accepted an optional
    argument as the message to format (defaulting to gptel's system
    prompt), which caused a type mismatch leading to errors.  We never
    actually used `gptel-system-prompt--format' to format anything
    except the system prompt, so remove this optional argument.
---
 gptel-transient.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/gptel-transient.el b/gptel-transient.el
index 183350e59e..e6c0036413 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -300,21 +300,20 @@ documention.  Return nil if user does not provide a 
number, for default."
         (num (read-number prompt -1 history)))
     (if (= num -1) nil num)))
 
-(defun gptel-system-prompt--format (&optional message)
-  "Format the system MESSAGE for display in gptel's transient menus.
+(defun gptel-system-prompt--format ()
+  "Format the system prompt for display in gptel's transient menus.
 
-Handle formatting for system messages when the active
-`gptel-model' does not support system messages."
-  (setq message (or message gptel--system-message))
+Handle formatting for system messages when the active `gptel-model' does
+not support system messages."
   (if (gptel--model-capable-p 'nosystem)
       (concat (propertize "[No system message support for model "
                           'face 'transient-heading)
               (propertize (gptel--model-name gptel-model)
                           'face 'warning)
               (propertize "]" 'face 'transient-heading))
-    (if message
+    (if gptel--system-message
         (gptel--describe-directive
-         message (max (- (window-width) 12) 14) "⮐ ")
+         gptel--system-message (max (- (window-width) 12) 14) "⮐ ")
       "[No system message set]")))
 
 (defun gptel--tools-init-value (obj)

Reply via email to