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.)
This commit is contained in:
Karthik Chikmagalur 2024-03-21 10:40:31 -07:00
parent 34a52aa047
commit 12e00cbd09

View file

@ -599,10 +599,9 @@ Or in an extended conversation:
((member "m" args) ((member "m" args)
(read-string (read-string
(format "Ask %s: " (gptel-backend-name gptel-backend)) (format "Ask %s: " (gptel-backend-name gptel-backend))
(apply #'buffer-substring-no-properties (and (use-region-p)
(if (use-region-p) (buffer-substring-no-properties
(list (region-beginning) (region-end)) (region-beginning) (region-end)))))
(list (line-beginning-position) (line-end-position))))))
((member "y" args) ((member "y" args)
(unless (car-safe kill-ring) (unless (car-safe kill-ring)
(user-error "`kill-ring' is empty! Nothing to send")) (user-error "`kill-ring' is empty! Nothing to send"))