Closed eval-exec closed 7 months ago
This feature will break asynchronous behavior -- gptel will not move point or mess with the window in any way.
I added gptel-pre-response-hook
(latest commit) where you can manipulate the buffer/window as required. For instance you can now do
(add-hook 'gptel-pre-response-hook #'recenter)
to recenter the window before the response is inserted. If you want more fine-grained control, you can write a custom hook function. For example, you could move the query to the top of the window:
(defun gptel--recenter ()
"Move point to top of window"
(set-window-start nil (point)))
(add-hook 'gptel-pre-response-hook #'gptel--recenter)
You could also add to gptel-post-response-hook
instead, which will update the window after the response has been inserted.
For above example: when I ask ChatGPT a question, and the question is near the mode-line, then the buffer is growing, I have to scroll up to see the answer.
How can I make this buffer auto scroll up when the buffer is growing? I tried
auto-revert-tail-mode
, but it give me "This buffer is not a file".