Troy Brown via "General discussions about Org-mode."
<[email protected]> writes:

> Org source blocks don't respect the user's configuration of their
> desired major mode.  As a result, the source block may use a different
> major mode than what is specified in "major-mode-remap-alist"
> (introduced in Emacs 29)....
>
> I think all of this could be automatically addressed if Org used
> "major-mode-remap", back-ported for older Emacs versions (likely by
> creating "org-major-mode-remap" in "org-compat.el"), and used at the
> end of "org-src-get-lang-mode" to map the resultant major mode
> accordingly.  For Emacs 30+, "org-major-mode-remap" could just be
> aliased to "major-mode-remap", but for Emacs 29, it would look at
> "major-mode-remap-alist" (since "major-mode-remap-defaults" wasn't
> available until Emacs 30) and for Emacs versions before Emacs 29, it
> would just return the supplied mode without any remapping.  That would
> seem to automatically map the tree-sitter modes as expected.

Note that we do use major-mode-remap, when available (on main branch).
For Emacs 29, would you be interested to create a patch?
See https://orgmode.org/worg/org-contribute.html

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to