Closed rossviljoen closed 1 year ago
Thanks for the bug report. This makes sense, and a PR is welcome (but note that code-cells is on GNU ELPA, so you need to have the FSF copyright assignment paperwork).
Would it be sufficient to take major-mode-remap-alist
into account? Or is there a good reason to support the case where the user adds something directly to auto-mode-alist
?
I implemented now what you suggested, see code-cells--guess-mode
. One could customize things by advicing that function. It is a backwards-imcompatible change of the option code-cells-convert-ipynb-style
, so let's see if someone complains.
Thanks for the excellent package!
It would be nice if there were an easy way to use the new built-in tree-sitter modes in Emacs 29 (e.g.
python-ts-mode
instead ofpython-mode
). As far as I can tell, the only way to currently change which mode is activated is by passing an argument tocode-cells-convert-ipynb-style
, but as far as I can tell this doesn't provide a way to set a new mode per-language.Perhaps a nice way of generalising this would be to allow the argument to
code-cells-convert-ipynb-style
to be a function which can then compute the mode from thelang
? Let me know if there's any interest in this and I can have a crack at a PR.