gptel
gptel copied to clipboard
Add response color-coding & role setting for gptel buffer
The purpose of this PR is to somewhat alleviate some of the issues discussed in https://github.com/karthink/gptel/discussions/321, mainly the ambiguity around the ownership of text in the chat buffer.
Adds the function gptel-toggle-response-role
and the custom variable gptel-highlight-assistant-responses
, in addition to gptel-response-highlight-face
.
gptel-toggle-response-role
works in a DWIM fashion, toggling the entire role of a response at a point if no region is selected, and setting the role of a region otherwise.
~I did not change the sticky behavior~, although when I tested this, I found that it works better enabled if you have a non-empty prefix for user messages.
@inkbottle007 mentioned in https://github.com/karthink/gptel/discussions/321#discussioncomment-10056133 that such a solution is not ideal because of the various fonts introduced by the major modes. I don't entirely disagree, but maybe it would be possible to customize the face in a way that fits well within all possible 3 supported gptel major modes.