Open jagrg opened 1 month ago
The LLM is sending this string:
```javascript
some code
So gptel shows `#+begin_src javascript`. This is working as intended.
If you anticipate this problem, you can use gptel's post-response hook to replace it afterwards. Untested:
```emacs-lisp
(defun gptel-fix-src-header (beg end)
(save-excursion
(goto-char beg)
(while (re-search-forward "^#\\+begin_src javascript" end t)
(replace-match "#+begin_src js"))))
(add-hook 'gptel-post-response-functions #'gptel-fix-src-header)
It works, but since javascript is not a valid babel language (as opposed to js), perhaps the problem should be addressed internally, WDYT?
I need to make the markdown -> org pipeline user-customizable first. Then gptel can provide some utility functions for mini-fixes like this without having to resort to the post-response hook, which is a bit of a bludgeon. This is a low priority for now.
Do you know where I can find the list of babel names for languages?
Should be all the ob-*.el files in https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp
Gptel returns
#+begin_src javascript
when it should be#+begin_src js
. Any suggestion on how to fix this?