Skip to content

Commit

Permalink
gptel-transient: No pre-fill when reading from minibuffer
Browse files Browse the repository at this point in the history
* 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.)
  • Loading branch information
karthink committed Mar 21, 2024
1 parent 34a52aa commit 12e00cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gptel-transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 12e00cb

Please sign in to comment.