Hello, everyone. In org.el we have the following: (require (intern (concat "ob-" lang))) This is fine most of the time, however, there are exceptions. The one I am interested in is fortran/f90. There are separate fortran-mode and f90-mode, however, afaiu, just a single ob-fortran.el, which works fine with both of those. Moreover, when I make block like: #+begin_src fortran #+end_src or turns on syntax highlighting for fortran-mode, not for f90-mode. I can make blocks like: #+begin_src f90 #+end_src This makes syntax highlighting work, but evaluation doesn't, because org doesn't know that f90 and fortran have the same evaluation (compilation) function. I feel that this is a super minor thing that can be solved in, like, one line of code. But I don't seem to be able to find which one. Any suggestions? Vlad -- Yours sincerely, Vladimir Nikishkin
Vladimir Nikishkin <lockywolf@gmail.com> writes: > This is fine most of the time, however, there are exceptions. > The one I am interested in is fortran/f90. There are separate > fortran-mode and f90-mode, however, afaiu, just a single > ob-fortran.el, which works fine with both of those. In that case, you'd just need (fortran . t) in org-babel-load-languages, I think. > #+begin_src fortran > #+end_src > or turns on syntax highlighting for fortran-mode, not for f90-mode. > I can make blocks like: > #+begin_src f90 > #+end_src > This makes syntax highlighting work, but evaluation doesn't, because > org doesn't know that f90 and fortran have the same evaluation > (compilation) function. > > I feel that this is a super minor thing that can be solved in, like, > one line of code. But I don't seem to be able to find which one. > > Any suggestions? Perhaps you're looking for org-src-lang-modes? This (untested) might do what you want: (add-to-list 'org-src-lang-modes '("f90" . fortran))
>> (add-to-list 'org-src-lang-modes '("f90" . fortran)) Language alignment is fine. What needs to be done is to make org-babel use org-babel-execute:fortran for both begin_src fortran, and for begin_src f90. пн, 27 апр. 2020 г. в 12:12, Kyle Meyer <kyle@kyleam.com>: > > Vladimir Nikishkin <lockywolf@gmail.com> writes: > > > This is fine most of the time, however, there are exceptions. > > The one I am interested in is fortran/f90. There are separate > > fortran-mode and f90-mode, however, afaiu, just a single > > ob-fortran.el, which works fine with both of those. > > In that case, you'd just need (fortran . t) in org-babel-load-languages, > I think. > > > #+begin_src fortran > > #+end_src > > or turns on syntax highlighting for fortran-mode, not for f90-mode. > > I can make blocks like: > > #+begin_src f90 > > #+end_src > > This makes syntax highlighting work, but evaluation doesn't, because > > org doesn't know that f90 and fortran have the same evaluation > > (compilation) function. > > > > I feel that this is a super minor thing that can be solved in, like, > > one line of code. But I don't seem to be able to find which one. > > > > Any suggestions? > > Perhaps you're looking for org-src-lang-modes? This (untested) might do > what you want: > > (add-to-list 'org-src-lang-modes '("f90" . fortran)) -- Yours sincerely, Vladimir Nikishkin
Vladimir Nikishkin <lockywolf@gmail.com> writes:
>>> (add-to-list 'org-src-lang-modes '("f90" . fortran))
>
> Language alignment is fine. What needs to be done is to make org-babel
> use org-babel-execute:fortran for both begin_src fortran, and for
> begin_src f90.
Yeah, my suggestion doesn't make sense given you said there is a
f90-mode. Try two:
(org-babel-make-language-alias "f90" "fortran")
Assuming that works for you and is expected to work generally, it'd be
good to add that to ob-fortran.el.