Skip to content

Commit

Permalink
gptel-curl: Only convert to Org in Org buffers
Browse files Browse the repository at this point in the history
* gptel-curl.el (gptel-curl-get-response): Don't convert response
into org-mode unless the buffer from which the request originated
is in org-mode.  This makes `gptel-default-mode' less binding, and
only used when creating a new chat session with `gptel'.  Also,
gptel should now do the right thing depending on whether the
current buffer is in text, Markdown or Org modes.
  • Loading branch information
karthink committed Jul 21, 2023
1 parent a660e13 commit c20fba8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gptel-curl.el
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ the response is inserted into the current buffer after point."
(if gptel-stream
#'gptel-curl--stream-insert-response
#'gptel--insert-response))
:transformer (when (or (eq gptel-default-mode 'org-mode)
(eq (buffer-local-value
'major-mode
(plist-get info :buffer))
'org-mode))
:transformer (when (eq (buffer-local-value
'major-mode
(plist-get info :buffer))
'org-mode)
(gptel--stream-convert-markdown->org)))
info))
(if gptel-stream
Expand Down

0 comments on commit c20fba8

Please sign in to comment.