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

    gptel-transient: Fix redirection bug (#1121)
    
    * gptel-transient.el (gptel--suffix-send): When redirecting from
    the minibuffer to a new gptel session AND the current buffer is in
    `gptel-default-mode', hand a two-part (cons) prompt correctly,
    wrapping the first part in source markers.
---
 gptel-transient.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gptel-transient.el b/gptel-transient.el
index fbc21915150..a2f86953105 100644
--- a/gptel-transient.el
+++ b/gptel-transient.el
@@ -1677,7 +1677,7 @@ This sets the variable `gptel-include-tool-results', 
which see."
                   (buffer-local-value 'major-mode gptel-buffer)
                 gptel-default-mode)))
         ;; Add code fences or Org src markers around the reduced-prompt
-        (cond ((eq major-mode gptel-buffer-mode))
+        (cond ((and (stringp prompt) (eq major-mode gptel-buffer-mode)))
               ((provided-mode-derived-p gptel-buffer-mode 'org-mode)
                (setq reduced-prompt
                      (if (consp reduced-prompt);either (region . prompt) or 
prompt

Reply via email to