From 12e00cbd092de95ae7f11aa207cd41dd9fabf883 Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Thu, 21 Mar 2024 10:40:31 -0700 Subject: [PATCH] gptel-transient: No pre-fill when reading from minibuffer * gptel-transient.el (gptel--suffix-send): Don't pre-fill the minibuffer prompt with the current line when reading the query from the minibuffer. (If the region is active, it is used as the initial contents -- this behavior is unchanged.) --- gptel-transient.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gptel-transient.el b/gptel-transient.el index dc7b871..d7971fc 100644 --- a/gptel-transient.el +++ b/gptel-transient.el @@ -599,10 +599,9 @@ Or in an extended conversation: ((member "m" args) (read-string (format "Ask %s: " (gptel-backend-name gptel-backend)) - (apply #'buffer-substring-no-properties - (if (use-region-p) - (list (region-beginning) (region-end)) - (list (line-beginning-position) (line-end-position)))))) + (and (use-region-p) + (buffer-substring-no-properties + (region-beginning) (region-end))))) ((member "y" args) (unless (car-safe kill-ring) (user-error "`kill-ring' is empty! Nothing to send"))