gptel-transient: More visual feedback
* gptel.el (gptel): `gptel' only pops to the gptel buffer when called interactively. * gptel-transient.el: Pop up the gptel session buffer when the prompt is sent to it, but don't select it. Also message the user that the response has been redirected to the gptel session.
This commit is contained in:
parent
6202474a6e
commit
00abbf7597
2 changed files with 18 additions and 6 deletions
|
@ -328,7 +328,9 @@ will get progressively longer!"
|
|||
t))
|
||||
(point))
|
||||
(point))))))
|
||||
(setq position (with-current-buffer buffer (point)))
|
||||
(with-current-buffer buffer
|
||||
(gptel--update-header-line " Waiting..." 'warning)
|
||||
(setq position (point)))
|
||||
(setq output-to-other-buffer-p t))
|
||||
((setq buffer-name
|
||||
(cl-some (lambda (s) (and (string-prefix-p "-e" s)
|
||||
|
@ -352,7 +354,9 @@ will get progressively longer!"
|
|||
(with-current-buffer buffer
|
||||
(goto-char (point-max))
|
||||
(insert reduced-prompt)
|
||||
(setq position (point))))))
|
||||
(setq position (point))
|
||||
(when gptel-mode
|
||||
(gptel--update-header-line " Waiting..." 'warning))))))
|
||||
|
||||
(when in-place
|
||||
(setq prompt (gptel--create-prompt (point)))
|
||||
|
@ -375,7 +379,14 @@ will get progressively longer!"
|
|||
:position position
|
||||
:in-place (and in-place (not output-to-other-buffer-p))
|
||||
:stream stream
|
||||
:callback callback)))
|
||||
:callback callback)
|
||||
(when output-to-other-buffer-p
|
||||
(message (concat "Prompt sent to buffer: "
|
||||
(propertize buffer-name 'face 'help-key-binding)))
|
||||
(display-buffer
|
||||
buffer '((display-buffer-reuse-window
|
||||
display-buffer-pop-up-window)
|
||||
(reusable-frames . visible))))))
|
||||
|
||||
;; ** Set system message
|
||||
(transient-define-suffix gptel--suffix-system-message ()
|
||||
|
|
5
gptel.el
5
gptel.el
|
@ -618,11 +618,12 @@ buffer created or switched to."
|
|||
(t (funcall gptel-default-mode)))
|
||||
(unless gptel-mode (gptel-mode 1))
|
||||
(if (bobp) (insert (or initial (gptel-prompt-string))))
|
||||
(pop-to-buffer (current-buffer))
|
||||
(goto-char (point-max))
|
||||
(skip-chars-backward "\t\r\n")
|
||||
(when (called-interactively-p 'gptel)
|
||||
(pop-to-buffer (current-buffer))
|
||||
(message "Send your query with %s!"
|
||||
(substitute-command-keys "\\[gptel-send]"))
|
||||
(substitute-command-keys "\\[gptel-send]")))
|
||||
(current-buffer)))
|
||||
|
||||
(defun gptel--convert-markdown->org (str)
|
||||
|
|
Loading…
Add table
Reference in a new issue