I'm not well versed in elisp so maybe there is a more idiomatic way to fix this, but figured I'd give it a shot.
As best I understand it, in 3c01477c37f494e4421970dcf2ddb69c25958aa7 the code changed to use with-current-buffer orig-buf but then within that context the buffer-substring function acts on the original buffer where the command was issued from, not on the *gptel-system* buffer where the user has entered text, so it sets the prompt to the wrong thing.
Fix for https://github.com/karthink/gptel/issues/138
I'm not well versed in elisp so maybe there is a more idiomatic way to fix this, but figured I'd give it a shot.
As best I understand it, in 3c01477c37f494e4421970dcf2ddb69c25958aa7 the code changed to use
with-current-buffer orig-buf
but then within that context thebuffer-substring
function acts on the original buffer where the command was issued from, not on the*gptel-system*
buffer where the user has entered text, so it sets the prompt to the wrong thing.