xenodium / chatgpt-shell

ChatGPT and DALL-E Emacs shells + Org babel 🦄 + a shell maker for other providers
https://xenodium.com
GNU General Public License v3.0
827 stars 74 forks source link

Can we reset the `shell-maker--file` after clean the buffer? #227

Closed ccqpein closed 2 months ago

ccqpein commented 3 months ago

I found that if I save the transcript and clean the buffer, chatgpt doesn't know the conversation that happened before (which I think it shouldn't, that's why I clean and start a new conversation).

But if I save the previous conversation and then I want to save the new thread, it will save to the old file.

I find shell-maker--file is set after the first save.

https://github.com/xenodium/chatgpt-shell/blob/0efead292f053774bba3c0789370e8e383aa49ec/shell-maker.el#L949

and the second save will use the shell-maker--file I just gave.

I find the chatgpt-shell-clear-buffer actually the alias of comint-clear-buffer.

https://github.com/xenodium/chatgpt-shell/blob/0efead292f053774bba3c0789370e8e383aa49ec/chatgpt-shell.el#L545

I am thinking can we (setf shell-maker--file nil) after the chatgpt-shell-clear-buffer

Ideas:

Best, Thanks

ccqpein commented 2 months ago

Give the potential solution in #228

ccqpein commented 2 months ago

Solved by #228