emacs-openai / chatgpt

Use ChatGPT inside Emacs
GNU General Public License v3.0
185 stars 21 forks source link

I recommend removing (insert "Type response here...") #9

Open mindgitrwx opened 1 year ago

mindgitrwx commented 1 year ago

With evil mode, it's tedious to remove this all the time

jcs090218 commented 1 year ago

Thanks for the recommendation!

The text is used to inform users that the new window is a "text box". I'm proposing these solutions:

  1. Add a defcustom for this behavior.
  2. Use minibuffer instead (setq chatgpt-input-method 'minibuffer)

LMKWYT?

dustinfarris commented 1 year ago

I'm also having issues in evil mode (doom emacs). The chatgpt window is read-only, but pressing enter doesn't do anything. I haven't quite figured out the pattern but it seems to be sensitive to whether I'm in insert mode or not. If I manually remove read-only, then go into insert mode and press enter, then I'm prompted for a "response". Setting the input method to minibuffer doesn't seem to address the problem.

jcs090218 commented 1 year ago

If you are using evil-mode, then you might need to invoke the command manually M-x chatgpt-type-response.

ldenman commented 1 year ago

I would also request the removal. I'm not using evil, though, mine's a fairly basic config.

It may be somewhat of a user error, because I see that you can actually hit <Return><Return> and it will clear the text, prior to that I was using <CTRL-K>.

I'd just drop the text entirely personally.

jcs090218 commented 1 year ago

Oh, I almost forgot another option. How about (setq chatgpt-inhibit-input-afterward nil), it won't delete the input window afterward. 🤔

sw1nn commented 1 year ago

enabling delete-selection-mode seems to have the desired effect of removing the prompt once you start typing ?

(add-hook 'chatgpt-input-mode-hook #'delete-selection-mode)
jcs090218 commented 1 year ago

Ah, yes. I always have that on; I should probably mention it somewhere in the README. Thanks for bringing this up! :D

rommeswi commented 1 year ago

I agree with @mindgitrwx, I think the current behavior makes the package much less accessible for the large group of users who use evil-mode.

I also find that the input field is often too small. I need to enter golden-ratio mode in order to edit longer text. I would find behavior like the magit commit buffer much preferable which does not try to control too much how the buffer is displayed/used. One can still leave the prompt: "enter your text here" and later filter it out of the request.

jcs090218 commented 1 year ago

The package was designed with delete-selection-mode so once you type something the text goes away (overwrite). Another option is (setq chatgpt-inhibit-input-afterward nil) so the textbox remains.

I also find that the input field is often too small. I need to enter golden-ratio mode in order to edit longer text. I would find behavior like the magit commit buffer much preferable which does not try to control too much how the buffer is displayed/used. One can still leave the prompt: "enter your text here" and later filter it out of the request.

The textbox grows on its own.

2023-04-12-20-07-33

LMKWYT? 🤔

jcs090218 commented 1 year ago

I've made the text customizable, so you can simple set variable chatgpt-window-prompt to empty string. Hope that helps!