chep / copilot-chat.el

Chat with Github copilot in Emacs !
MIT License
56 stars 5 forks source link

org-mode support? #10

Closed fkgruber closed 2 days ago

fkgruber commented 1 month ago

Thanks for bringing copilot chat support to emacs. Seems like org-mode support would be really useful. Any plans?

chep commented 1 month ago

What do you mean by org-mode support ? I don't use org-mode but if you can tell me more, I can have a look.

fkgruber commented 1 month ago

You can see some of the features here: https://orgmode.org/features.html

But basically instead of putting the results on a text buffer you could use orgmode format. This way you add headings, source code in any language, etc. Afterwards the user can execute code get results and so on.

chep commented 1 month ago

Please try org-mode branch and tell me what you need.

chep commented 1 month ago

I created a new branch named frontend and will continue on it. You can set copilot-chat-frontend to 'org to have the same behavior as org-mode branch. I have trouble with the prompt to make copilot use org syntax. Despite my prompt telling explicitly to use this syntax and not markdown, it sometimes still use markdown... I found a tool named pandoc to convert markdown to org but it would be better not to depend on an external program. If you have any idea, tell me.

fkgruber commented 1 month ago

I tried the orgmode branch and seems to work. However I noticed when I asked to generate some elisp code I got: * [08:56:19]* Sure, to print text in Emacs Lisp (elisp), you can use the message function. Here's an example:

+BEGIN_SRCisp

(message "Hi")

+END_SRC

When you evaluate this code,Hi" will be printed in the echo (the line at the bottom of the Emacs window).

instead of #+BEGIN_SRC elisp

fkgruber commented 1 month ago

also it would be useful to have an option where the output is written on an existing file. For example, I may have an opened org file then I could call a function that would let me make a query and write the results to the same file

chep commented 1 month ago

I tried the orgmode branch and seems to work. However I noticed when I asked to generate some elisp code I got: ** [08:56:19] Sure, to print text in Emacs Lisp (elisp), you can use the message function. Here's an example:

+BEGIN_SRCisp (message "Hi") #+END_SRC

When you evaluate this code,Hi" will be printed in the echo (the line at the bottom of the Emacs window).

instead of #+BEGIN_SRC elisp

You are missing some data "emacs-l" token has been lost. I had the problem in the past. Try the frontends branch, this should be resolved.

chep commented 2 weeks ago

Hi,

I added copilot-chat-ask-and-insert. It should do what you want.