emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: dalanicolai <dalanicolai@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: What's up with ob-template.el? It seems heavily outdated
Date: Sat, 25 Sep 2021 23:46:08 +0200	[thread overview]
Message-ID: <CACJP=3kEup-jornAXPgGP68S8goc5QvHt77fyBnjuuGG3zXGrA@mail.gmail.com> (raw)
In-Reply-To: <874ka84u0t.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1264 bytes --]

Hi Bastien,

For sure I am happy to contribute it to (w)org.

I have very recently assigned copyright to the FSF for sketch-mode
<https://github.com/dalanicolai/sketch-mode> (it is currently on
https://elpa.gnu.org/devel/).
So do I have to assign separately again for this contribution? (Would be no
problem of course, just a question)

Anyway, I will already attach the patch. For some reason my Emacs (i.e.
Spacemacs) also reformats the table with
supported languages in index.org. So, maybe you can check if it is
correctly formatted. As I updated this long ago,
it would take me too long to look again at this now (so therefore, I simply
added a link to a mail from Eric Schulte
with some more info), but it should be better than the current info, and a
very acceptable (re)start.

Regards,
Daniel


On Sat, 25 Sept 2021 at 16:19, Bastien <bzg@gnu.org> wrote:

> Hi,
>
> thanks for your work on ob-template.el.
>
> Would you be willing to contribute it to Org's core?
>
> If so, please fill in this form:
> https://orgmode.org/request-assign-future.txt
>
> Once that's done, please send a patch to this list against the main
> branch.  See the instructions on contributing here:
>
> https://orgmode.org/worg/org-contribute.html
>
> Thanks!
>
> --
>  Bastien
>

[-- Attachment #1.2: Type: text/html, Size: 2056 bytes --]

[-- Attachment #2: 0001-Update-ob-template.el-file.patch --]
[-- Type: text/x-patch, Size: 40761 bytes --]

From e75d75bd60dcc8074e2712936d19d4147ef79fa2 Mon Sep 17 00:00:00 2001
From: Daniel Nicolai <dalanicolai@gmail.com>
Date: Sat, 25 Sep 2021 22:58:39 +0200
Subject: [PATCH] Update ob-template.el file

---
 org-contrib/babel/languages/index.org | 220 +++++++++++++++-----------
 org-contrib/babel/ob-template.el      |  61 +++++--
 2 files changed, 168 insertions(+), 113 deletions(-)

diff --git a/org-contrib/babel/languages/index.org b/org-contrib/babel/languages/index.org
index 626b81ff..2d582ff7 100644
--- a/org-contrib/babel/languages/index.org
+++ b/org-contrib/babel/languages/index.org
@@ -31,103 +31,103 @@ the Emacs package system.
 
 #+caption: Languages supported by Babel
 #+name: babel-languages
-| Core language        | Identifier  | Requirements                                   | Maintainer        |
-|----------------------+-------------+------------------------------------------------+-------------------|
-| [[file:ob-doc-abc.org][ABC]]                  | =abc=         | [[http://moinejf.free.fr/][abcm2ps]], [[https://github.com/mkjunker/abc-mode][abc-mode]]                              | William Waites    |
-| [[file:ob-doc-asymptote.org][Asymptote]]            | =asymptote=   | [[http://asymptote.sourceforge.net/][Asymptote]], [[http://asymptote.sourceforge.net/doc/Editing-modes.html][asy-mode]]                            | Luc Pellissier    |
-| [[file:ob-doc-awk.org][Awk]]                  | =awk=         | AWK                                            | Tyler Smith       |
-| [[file:ob-doc-C.org][C]]                    | =C=           | none                                           | Thierry Banel     |
-| [[file:ob-doc-C.org][C++]]                  | =cpp=         | none                                           |                   |
-| Calc                 | =calc=        | none                                           | Tom Gillespie     |
-| [[file:ob-doc-clojure.org][Clojure]]              | =clojure=     | [[http://clojure.org/][Clojure]], [[https://github.com/clojure-emacs/clojure-mode][Clojure Mode]], [[https://github.com/clojure-emacs/cider][CIDER]], [[http://leiningen.org/][Leiningen]]        | Bastien Guerry    |
-| comint               | =comint=      |                                                |                   |
-| Coq                  | =coq=         | [[https://coq.inria.fr/][Coq]], [[https://proofgeneral.github.io/][Proof General]]                             | Luc Pellissier    |
-| [[file:ob-doc-css.org][CSS]]                  | =css=         | none                                           |                   |
-| [[file:ob-doc-C.org][D]]                    | =D=           | [[http://dlang.org][D]]                                              |                   |
-| [[file:ob-doc-ditaa.org][Ditaa]]                | =ditaa=       | [[http://ditaa.sourceforge.net][ditaa]] (bundled with Org-mode)                  |                   |
-| [[file:ob-doc-dot.org][Dot (Graphviz)]]       | =dot=         | [[http://www.graphviz.org/][dot]]                                            | Justin Abrahms    |
-| ebnf                 | =ebnf=        | [[https://www.emacswiki.org/emacs/EbnfToPsPackage][ebnf2ps]]                                        |                   |
-| Emacs Lisp           | =emacs-lisp=  | none                                           |                   |
-| [[file:ob-doc-eshell.org][eshell]]               | =eshell=      | eshell                                         | stardiviner       |
-| Forth                | =forth=       | [[https://www.gnu.org/software/gforth/][gforth]]                                         |                   |
-| Fortran              | =F90=         | fortran                                        |                   |
-| [[file:ob-doc-gnuplot.org][Gnuplot]]              | =gnuplot=     | [[http://www.gnuplot.info/][gnuplot]], [[http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html][gnuplot-mode]]                          |                   |
-| Groovy               | =groovy=      | [[https://groovy-lang.org/][Apache Groovy]]                                  | Palak Mathur      |
-| Haskell              | =haskell=     | [[http://www.haskell.org/][haskell]], [[http://projects.haskell.org/haskellmode-emacs/][haskell-mode]], [[http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs#inf-haskell.el:_the_best_thing_since_the_breadknife][inf-haskell]], [[http://people.cs.uu.nl/andres/lhs2tex/][lhs2tex]]    | Lawrence Bottorff |
-| hledger              | =hledger=     | [[https://hledger.org/][hledger]]                                        |                   |
-| Io                   | =io=          | [[https://iolanguage.org/index.html][Io]], java                                       |                   |
-| [[file:ob-doc-J.org][J]]                    | =J=           | [[http://www.jsoftware.com/][J]], [[https://github.com/zellio/j-mode][j-mode]]                                      | Joseph Novakovich |
-| [[file:ob-doc-java.org][Java]]                 | =java=        | [[https://openjdk.java.net/][Java]]                                           | Ian Martins       |
-| [[file:ob-doc-js.org][Javascript]]           | =js=          | [[http://nodejs.org/][node.js]]                                        |                   |
-| [[file:ob-doc-LaTeX.org][LaTeX]]                | =latex=       | [[http://www.latex-project.org/][latex]], [[http://www.gnu.org/software/auctex/][auctex]], [[http://www.gnu.org/software/auctex/reftex.html][reftex]]                          |                   |
-| [[file:ob-doc-ledger.org][Ledger]]               | =ledger=      | [[http://wiki.github.com/jwiegley/ledger/][ledger]]                                         | Eric S. Fraga     |
-| [[file:ob-doc-lilypond.org][Lilypond]]             | =ly=          | [[http://lilypond.org/][LilyPond]]                                       |                   |
-| [[file:ob-doc-lisp.org][Lisp]]                 | =lisp=        | lisp, [[http://common-lisp.net/project/slime/][Slime]]                                    |                   |
-| lua                  | =lua=         | [[http://www.lua.org/][lua]]                                            |                   |
-| [[file:ob-doc-makefile.org][Make]]                 | =makefile=    | none                                           |                   |
-| [[file:ob-doc-octave-matlab.org][Matlab]]               | =matlab=      | [[https://www.mathworks.com/products/matlab.html][MATLAB]], [[http://sourceforge.net/projects/matlab-emacs/][matlab.el]]                              |                   |
-| [[file:ob-doc-maxima.org][Maxima]]               | =max=         | [[http://maxima.sourceforge.net/][Maxima]], Common Lisp, gnuplot (optional)        |                   |
-| [[file:ob-doc-mscgen.org][Mscgen]]               | =mscgen=      | [[http://www.mcternan.me.uk/mscgen/][Mscgen]]                                         | Justin Abrahms    |
-| Objective Caml       | =ocaml=       | [[http://caml.inria.fr/][ocaml]], [[http://www-rocq.inria.fr/~acohen/tuareg/][tuareg-mode]]                             |                   |
-| [[file:ob-doc-octave-matlab.org][Octave]]               | =octave=      | [[https://www.gnu.org/software/octave/][Octave]]                                         |                   |
-| Org                  | =org=         | none                                           |                   |
-| [[file:ob-doc-perl.org][Perl]]                 | =perl=        | [[http://www.perl.org/][perl]], [[http://www.emacswiki.org/emacs/CPerlMode][cperl-mode]] (optional)                    | Corwin Brust      |
-| [[file:ob-doc-picolisp.org][Picolisp]]             | =picolisp=    | [[http://picolisp.com/5000/!wiki?home][PicoLisp]]                                       |                   |
-| PlantUML             | =plantuml=    | [[https://plantuml.com][PlantUML]]                                       |                   |
-| Processing           | =processing=  | [[https://processing.org/][Processing]]                                     |                   |
-| [[file:ob-doc-python.org][Python]]               | =python=      | [[http://www.python.org/][python]], [[https://launchpad.net/python-mode][python-mode]] (optional)                 | Jack Kamm         |
-| [[file:ob-doc-R.org][R]]                    | =R=           | [[http://www.r-project.org/][R]], [[http://ess.r-project.org/][ess-mode]], [[http://cran.r-project.org/web/packages/tikzDevice/index.html][tikzDevice]]                        | Jeremie Juste     |
-| Ruby                 | =ruby=        | [[http://www.ruby-lang.org/][ruby]], [[http://www.ruby-lang.org/][irb]], [[http://github.com/eschulte/rinari/raw/master/util/ruby-mode.el][ruby-mode]], [[http://github.com/eschulte/rinari/raw/master/util/inf-ruby.el][inf-ruby mode]]            |                   |
-| Sass                 | =sass=        | [[http://sass-lang.com/][Sass]], [[http://github.com/nex3/haml/blob/master/extra/sass-mode.el][sass-mode]]                                |                   |
-| Scheme               | =scheme=      | none                                           |                   |
-| [[file:ob-doc-screen.org][Screen]]               | =screen=      | [[https://www.gnu.org/software/screen/][GNU Screen]]                                     | Ken Mankoff       |
-| Sed                  | =sed=         | [[https://www.gnu.org/software/sed/][sed]]                                            |                   |
-| shell                | =shell=       | a shell                                        |                   |
-| Shen                 | =shen=        | [[http://www.shenlanguage.org/][Shen]], [[http://elpa.gnu.org/packages/shen-mode.html][shen-mode]]                                |                   |
-| [[file:ob-doc-sql.org][SQL]]                  | =sql=         | an RDBMS                                       |                   |
-| [[file:ob-doc-sqlite.org][SQLite]]               | =sqlite=      | [[http://www.sqlite.org/index.html][SQLite]], [[http://www.sqlite.org/sqlite.html][sqlite3]], [[http://www.emacswiki.org/emacs/SqlMode][SQL mode]]                      | Nick Savage       |
-| [[file:ob-doc-stan.org][Stan]]                 | =stan=        | [[http://mc-stan.org/][Stan]], [[https://github.com/stan-dev/stan-mode][Stan mode]]                                |                   |
-| [[file:ob-doc-vala.org][Vala]]                 | =vala=        | [[https://wiki.gnome.org/Projects/Vala][Vala]]                                           |                   |
-|                      |             |                                                |                   |
-|----------------------+-------------+------------------------------------------------+-------------------|
-| *Contrib language*     | *Identifier*  | *Requirements*                                   | *Maintainer*        |
-|----------------------+-------------+------------------------------------------------+-------------------|
-| Arduino              | =arduino=     | [[https://www.arduino.cc/][Arduino]]                                        |                   |
-| C#                   | =csharp=      | [[https://github.com/mono/mono][mono]]                                           |                   |
-| [[file:ob-doc-eukleides.org][Eukleides]]            | =eukleides=   | [[http://eukleides.org/][eukleides]]                                      |                   |
-| Fomus                | =fomus=       | [[http://fomus.sourceforge.net/][fomus (music notation)]]                         |                   |
-| [[https://github.com/gjkerns/ob-julia/blob/master/ob-julia-doc.org][Julia]]                | =julia=       | [[http://ess.r-project.org][ess]]                                            |                   |
-| Mathematica          | =mathematica= | [[https://www.wolfram.com/mathematica/][Mathematica]]                                    |                   |
-| [[file:ob-doc-mathomatic.org][Mathomatic]]           | =mathomatic=  | [[https://github.com/mfillpot/mathomatic][Mathomatic]]                                     |                   |
-| [[file:ob-doc-oz.org][OZ]]                   | =oz=          | [[http://www.mozart2.org/][Mozart]] which includes a major mode             |                   |
-| php                  | =php=         | [[https://www.php.net/][PHP]]                                            |                   |
-| redis                | =redis=       | [[https://redis.io/][redis]]                                          |                   |
-| sclang               | =sclang=      | [[https://supercollider.github.io/][SuperCollider]]                                  |                   |
-| smiles               | =smiles=      |                                                |                   |
-| spice                | =spice=       | [[http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/][SPICE]]                                          |                   |
-| [[file:ob-doc-stata.org][Stata]]                | =stata=       | [[http://stata.com/][Stata]], [[http://ess.r-project.org/][ess-mode]]                                |                   |
-| [[file:ob-doc-tcl.org][Tcl]]                  | =tcl=         | [[http://www.tcl.tk/][tclsh]]                                          |                   |
-| VB.net               | =vbnet=       | [[https://github.com/mono/mono][mono]], [[https://www.mankier.com/package/mono-basic][vbnc]]                                     |                   |
-|                      |             |                                                |                   |
-|----------------------+-------------+------------------------------------------------+-------------------|
-| *Package language*     | *Identifier*  | *Requirements*                                   | *Maintainer*        |
-|----------------------+-------------+------------------------------------------------+-------------------|
+| Core language        | Identifier      | Requirements                                   | Maintainer        |
+|----------------------+-----------------+------------------------------------------------+-------------------|
+| [[file:ob-doc-abc.org][ABC]]                  | =abc=           | [[http://moinejf.free.fr/][abcm2ps]], [[https://github.com/mkjunker/abc-mode][abc-mode]]                              | William Waites    |
+| [[file:ob-doc-asymptote.org][Asymptote]]            | =asymptote=     | [[http://asymptote.sourceforge.net/][Asymptote]], [[http://asymptote.sourceforge.net/doc/Editing-modes.html][asy-mode]]                            | Luc Pellissier    |
+| [[file:ob-doc-awk.org][Awk]]                  | =awk=           | AWK                                            | Tyler Smith       |
+| [[file:ob-doc-C.org][C]]                    | =C=             | none                                           | Thierry Banel     |
+| [[file:ob-doc-C.org][C++]]                  | =cpp=           | none                                           |                   |
+| Calc                 | =calc=          | none                                           | Tom Gillespie     |
+| [[file:ob-doc-clojure.org][Clojure]]              | =clojure=       | [[http://clojure.org/][Clojure]], [[https://github.com/clojure-emacs/clojure-mode][Clojure Mode]], [[https://github.com/clojure-emacs/cider][CIDER]], [[http://leiningen.org/][Leiningen]]        | Bastien Guerry    |
+| comint               | =comint=        |                                                |                   |
+| Coq                  | =coq=           | [[https://coq.inria.fr/][Coq]], [[https://proofgeneral.github.io/][Proof General]]                             | Luc Pellissier    |
+| [[file:ob-doc-css.org][CSS]]                  | =css=           | none                                           |                   |
+| [[file:ob-doc-C.org][D]]                    | =D=             | [[http://dlang.org][D]]                                              |                   |
+| [[file:ob-doc-ditaa.org][Ditaa]]                | =ditaa=         | [[http://ditaa.sourceforge.net][ditaa]] (bundled with Org-mode)                  |                   |
+| [[file:ob-doc-dot.org][Dot (Graphviz)]]       | =dot=           | [[http://www.graphviz.org/][dot]]                                            | Justin Abrahms    |
+| ebnf                 | =ebnf=          | [[https://www.emacswiki.org/emacs/EbnfToPsPackage][ebnf2ps]]                                        |                   |
+| Emacs Lisp           | =emacs-lisp=    | none                                           |                   |
+| [[file:ob-doc-eshell.org][eshell]]               | =eshell=        | eshell                                         | stardiviner       |
+| Forth                | =forth=         | [[https://www.gnu.org/software/gforth/][gforth]]                                         |                   |
+| Fortran              | =F90=           | fortran                                        |                   |
+| [[file:ob-doc-gnuplot.org][Gnuplot]]              | =gnuplot=       | [[http://www.gnuplot.info/][gnuplot]], [[http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html][gnuplot-mode]]                          |                   |
+| Groovy               | =groovy=        | [[https://groovy-lang.org/][Apache Groovy]]                                  | Palak Mathur      |
+| Haskell              | =haskell=       | [[http://www.haskell.org/][haskell]], [[http://projects.haskell.org/haskellmode-emacs/][haskell-mode]], [[http://www.haskell.org/haskellwiki/Haskell_mode_for_Emacs#inf-haskell.el:_the_best_thing_since_the_breadknife][inf-haskell]], [[http://people.cs.uu.nl/andres/lhs2tex/][lhs2tex]]    | Lawrence Bottorff |
+| hledger              | =hledger=       | [[https://hledger.org/][hledger]]                                        |                   |
+| Io                   | =io=            | [[https://iolanguage.org/index.html][Io]], java                                       |                   |
+| [[file:ob-doc-J.org][J]]                    | =J=             | [[http://www.jsoftware.com/][J]], [[https://github.com/zellio/j-mode][j-mode]]                                      | Joseph Novakovich |
+| [[file:ob-doc-java.org][Java]]                 | =java=          | [[https://openjdk.java.net/][Java]]                                           | Ian Martins       |
+| [[file:ob-doc-js.org][Javascript]]           | =js=            | [[http://nodejs.org/][node.js]]                                        |                   |
+| [[file:ob-doc-LaTeX.org][LaTeX]]                | =latex=         | [[http://www.latex-project.org/][latex]], [[http://www.gnu.org/software/auctex/][auctex]], [[http://www.gnu.org/software/auctex/reftex.html][reftex]]                          |                   |
+| [[file:ob-doc-ledger.org][Ledger]]               | =ledger=        | [[http://wiki.github.com/jwiegley/ledger/][ledger]]                                         | Eric S. Fraga     |
+| [[file:ob-doc-lilypond.org][Lilypond]]             | =ly=            | [[http://lilypond.org/][LilyPond]]                                       |                   |
+| [[file:ob-doc-lisp.org][Lisp]]                 | =lisp=          | lisp, [[http://common-lisp.net/project/slime/][Slime]]                                    |                   |
+| lua                  | =lua=           | [[http://www.lua.org/][lua]]                                            |                   |
+| [[file:ob-doc-makefile.org][Make]]                 | =makefile=      | none                                           |                   |
+| [[file:ob-doc-octave-matlab.org][Matlab]]               | =matlab=        | [[https://www.mathworks.com/products/matlab.html][MATLAB]], [[http://sourceforge.net/projects/matlab-emacs/][matlab.el]]                              |                   |
+| [[file:ob-doc-maxima.org][Maxima]]               | =max=           | [[http://maxima.sourceforge.net/][Maxima]], Common Lisp, gnuplot (optional)        |                   |
+| [[file:ob-doc-mscgen.org][Mscgen]]               | =mscgen=        | [[http://www.mcternan.me.uk/mscgen/][Mscgen]]                                         | Justin Abrahms    |
+| Objective Caml       | =ocaml=         | [[http://caml.inria.fr/][ocaml]], [[http://www-rocq.inria.fr/~acohen/tuareg/][tuareg-mode]]                             |                   |
+| [[file:ob-doc-octave-matlab.org][Octave]]               | =octave=        | [[https://www.gnu.org/software/octave/][Octave]]                                         |                   |
+| Org                  | =org=           | none                                           |                   |
+| [[file:ob-doc-perl.org][Perl]]                 | =perl=          | [[http://www.perl.org/][perl]], [[http://www.emacswiki.org/emacs/CPerlMode][cperl-mode]] (optional)                    | Corwin Brust      |
+| [[file:ob-doc-picolisp.org][Picolisp]]             | =picolisp=      | [[http://picolisp.com/5000/!wiki?home][PicoLisp]]                                       |                   |
+| PlantUML             | =plantuml=      | [[https://plantuml.com][PlantUML]]                                       |                   |
+| Processing           | =processing=    | [[https://processing.org/][Processing]]                                     |                   |
+| [[file:ob-doc-python.org][Python]]               | =python=        | [[http://www.python.org/][python]], [[https://launchpad.net/python-mode][python-mode]] (optional)                 | Jack Kamm         |
+| [[file:ob-doc-R.org][R]]                    | =R=             | [[http://www.r-project.org/][R]], [[http://ess.r-project.org/][ess-mode]], [[http://cran.r-project.org/web/packages/tikzDevice/index.html][tikzDevice]]                        | Jeremie Juste     |
+| Ruby                 | =ruby=          | [[http://www.ruby-lang.org/][ruby]], [[http://www.ruby-lang.org/][irb]], [[http://github.com/eschulte/rinari/raw/master/util/ruby-mode.el][ruby-mode]], [[http://github.com/eschulte/rinari/raw/master/util/inf-ruby.el][inf-ruby mode]]            |                   |
+| Sass                 | =sass=          | [[http://sass-lang.com/][Sass]], [[http://github.com/nex3/haml/blob/master/extra/sass-mode.el][sass-mode]]                                |                   |
+| Scheme               | =scheme=        | none                                           |                   |
+| [[file:ob-doc-screen.org][Screen]]               | =screen=        | [[https://www.gnu.org/software/screen/][GNU Screen]]                                     | Ken Mankoff       |
+| Sed                  | =sed=           | [[https://www.gnu.org/software/sed/][sed]]                                            |                   |
+| shell                | =shell=         | a shell                                        |                   |
+| Shen                 | =shen=          | [[http://www.shenlanguage.org/][Shen]], [[http://elpa.gnu.org/packages/shen-mode.html][shen-mode]]                                |                   |
+| [[file:ob-doc-sql.org][SQL]]                  | =sql=           | an RDBMS                                       |                   |
+| [[file:ob-doc-sqlite.org][SQLite]]               | =sqlite=        | [[http://www.sqlite.org/index.html][SQLite]], [[http://www.sqlite.org/sqlite.html][sqlite3]], [[http://www.emacswiki.org/emacs/SqlMode][SQL mode]]                      | Nick Savage       |
+| [[file:ob-doc-stan.org][Stan]]                 | =stan=          | [[http://mc-stan.org/][Stan]], [[https://github.com/stan-dev/stan-mode][Stan mode]]                                |                   |
+| [[file:ob-doc-vala.org][Vala]]                 | =vala=          | [[https://wiki.gnome.org/Projects/Vala][Vala]]                                           |                   |
+|                      |                 |                                                |                   |
+|----------------------+-----------------+------------------------------------------------+-------------------|
+| *Contrib language*   | *Identifier*    | *Requirements*                                 | *Maintainer*      |
+|----------------------+-----------------+------------------------------------------------+-------------------|
+| Arduino              | =arduino=       | [[https://www.arduino.cc/][Arduino]]                                        |                   |
+| C#                   | =csharp=        | [[https://github.com/mono/mono][mono]]                                           |                   |
+| [[file:ob-doc-eukleides.org][Eukleides]]            | =eukleides=     | [[http://eukleides.org/][eukleides]]                                      |                   |
+| Fomus                | =fomus=         | [[http://fomus.sourceforge.net/][fomus (music notation)]]                         |                   |
+| [[https://github.com/gjkerns/ob-julia/blob/master/ob-julia-doc.org][Julia]]                | =julia=         | [[http://ess.r-project.org][ess]]                                            |                   |
+| Mathematica          | =mathematica=   | [[https://www.wolfram.com/mathematica/][Mathematica]]                                    |                   |
+| [[file:ob-doc-mathomatic.org][Mathomatic]]           | =mathomatic=    | [[https://github.com/mfillpot/mathomatic][Mathomatic]]                                     |                   |
+| [[file:ob-doc-oz.org][OZ]]                   | =oz=            | [[http://www.mozart2.org/][Mozart]] which includes a major mode             |                   |
+| php                  | =php=           | [[https://www.php.net/][PHP]]                                            |                   |
+| redis                | =redis=         | [[https://redis.io/][redis]]                                          |                   |
+| sclang               | =sclang=        | [[https://supercollider.github.io/][SuperCollider]]                                  |                   |
+| smiles               | =smiles=        |                                                |                   |
+| spice                | =spice=         | [[http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/][SPICE]]                                          |                   |
+| [[file:ob-doc-stata.org][Stata]]                | =stata=         | [[http://stata.com/][Stata]], [[http://ess.r-project.org/][ess-mode]]                                |                   |
+| [[file:ob-doc-tcl.org][Tcl]]                  | =tcl=           | [[http://www.tcl.tk/][tclsh]]                                          |                   |
+| VB.net               | =vbnet=         | [[https://github.com/mono/mono][mono]], [[https://www.mankier.com/package/mono-basic][vbnc]]                                     |                   |
+|                      |                 |                                                |                   |
+|----------------------+-----------------+------------------------------------------------+-------------------|
+| *Package language*   | *Identifier*    | *Requirements*                                 | *Maintainer*      |
+|----------------------+-----------------+------------------------------------------------+-------------------|
 | [[https://bitbucket.org/pdo/axiom-environment][Axiom]]                | =axiom=, =spad= | [[http://www.axiom-developer.org/][axiom]], [[http://www.open-axiom.org/][OpenAxiom]], or [[http://fricas.sourceforge.net/][FriCAS]], [[https://bitbucket.org/pdo/axiom-environment/][axiom-environment]] |                   |
-| [[https://github.com/zweifisch/ob-elixir][Elixir]]               | =elixir=      | [[http://elixir-lang.org/][elixir]], [[http://www.erlang.org/][Erlang]]                                 |                   |
-| [[https://github.com/krisajenkins/ob-translate][Google Translate]]     | =translate=   | [[https://github.com/atykhonov/google-translate][google-translate]]                               |                   |
-| [[file:ob-doc-haxe.org][Haxe]]                 | =haxe=        | [[https://haxe.org/][Haxe]]                                           |                   |
-| [[https://github.com/krisajenkins/ob-browser][HTML]]                 | =browser=     | [[http://phantomjs.org/][PhantomJS]], ob-browser.js                       |                   |
-| [[https://github.com/zweifisch/ob-http][http request]]         | =http=        | [[http://curl.haxx.se/][cURL]]                                           |                   |
-| [[https://github.com/gregsexton/ob-ipython][iPython]]              | =ipython=     | [[file:ob-doc-python.org][ob-python]]                                      |                   |
-| [[http://github.com/zweifisch/ob-kotlin][Kotlin]]               | =kotlin=      | [[http://kotlinlang.org/][Kotlin]], [[https://github.com/quantumman/emacs.d/blob/master/auto-install/kotlin-mode.el][kotlin-mode]]                            |                   |
-| Lisp Flavored Erlang | =lfe=         | [[http://lfe.io/][lfe]]                                            |                   |
-| [[https://github.com/krisajenkins/ob-mongo][MongoDB]]              | =mongo=       | [[https://www.mongodb.org/][MongoDB]]                                        |                   |
-| [[https://github.com/zweifisch/ob-cypher][Neo4j]]                | =cypher=      | [[http://neo4j.com/][neo4j]], [[https://github.com/fxbois/cypher-mode][cypher-mode]]                             |                   |
-| [[https://github.com/ljos/ob-prolog][Prolog]]               | =prolog=      | [[http://www.swi-prolog.org/][SWI Prolog]]                                     |                   |
-| [[https://github.com/millarc/ob-rec.el][rec]]                  | =rec=         | [[https://www.gnu.org/software/recutils/][GNU Recutils]]                                   |                   |
-| Scala                | =scala=       | [[http://www.scala-lang.org][Scala]]                                          |                   |
-| [[https://github.com/swannodette/ob-sml][Standard ML]]          | =sml=         | [[https://en.wikipedia.org/wiki/Standard_ML][Standard ML]], [[http://www.iro.umontreal.ca/~monnier/elisp/][sml-mode]]                          |                   |
-| [[https://github.com/lurdan/ob-typescript][Typescript]]           | =typescript=  | [[https://nodejs.org/][node.js]], [[https://www.npmjs.com/package/typescript][typescript]]                            |                   |
+| [[https://github.com/zweifisch/ob-elixir][Elixir]]               | =elixir=        | [[http://elixir-lang.org/][elixir]], [[http://www.erlang.org/][Erlang]]                                 |                   |
+| [[https://github.com/krisajenkins/ob-translate][Google Translate]]     | =translate=     | [[https://github.com/atykhonov/google-translate][google-translate]]                               |                   |
+| [[file:ob-doc-haxe.org][Haxe]]                 | =haxe=          | [[https://haxe.org/][Haxe]]                                           |                   |
+| [[https://github.com/krisajenkins/ob-browser][HTML]]                 | =browser=       | [[http://phantomjs.org/][PhantomJS]], ob-browser.js                       |                   |
+| [[https://github.com/zweifisch/ob-http][http request]]         | =http=          | [[http://curl.haxx.se/][cURL]]                                           |                   |
+| [[https://github.com/gregsexton/ob-ipython][iPython]]              | =ipython=       | [[file:ob-doc-python.org][ob-python]]                                      |                   |
+| [[http://github.com/zweifisch/ob-kotlin][Kotlin]]               | =kotlin=        | [[http://kotlinlang.org/][Kotlin]], [[https://github.com/quantumman/emacs.d/blob/master/auto-install/kotlin-mode.el][kotlin-mode]]                            |                   |
+| Lisp Flavored Erlang | =lfe=           | [[http://lfe.io/][lfe]]                                            |                   |
+| [[https://github.com/krisajenkins/ob-mongo][MongoDB]]              | =mongo=         | [[https://www.mongodb.org/][MongoDB]]                                        |                   |
+| [[https://github.com/zweifisch/ob-cypher][Neo4j]]                | =cypher=        | [[http://neo4j.com/][neo4j]], [[https://github.com/fxbois/cypher-mode][cypher-mode]]                             |                   |
+| [[https://github.com/ljos/ob-prolog][Prolog]]               | =prolog=        | [[http://www.swi-prolog.org/][SWI Prolog]]                                     |                   |
+| [[https://github.com/millarc/ob-rec.el][rec]]                  | =rec=           | [[https://www.gnu.org/software/recutils/][GNU Recutils]]                                   |                   |
+| Scala                | =scala=         | [[http://www.scala-lang.org][Scala]]                                          |                   |
+| [[https://github.com/swannodette/ob-sml][Standard ML]]          | =sml=           | [[https://en.wikipedia.org/wiki/Standard_ML][Standard ML]], [[http://www.iro.umontreal.ca/~monnier/elisp/][sml-mode]]                          |                   |
+| [[https://github.com/lurdan/ob-typescript][Typescript]]           | =typescript=    | [[https://nodejs.org/][node.js]], [[https://www.npmjs.com/package/typescript][typescript]]                            |                   |
 
 
 Note: Many languages in Table [[babel-languages]] require
@@ -197,6 +197,34 @@ Developers are encouraged to read the [[file:../../org-contribute.org][Org-mode
 instructions]] in the hope that the language support can be included
 into the Org-mode core.
 
+** Some additional comments/development tips
+Although most of the instructions in ob-template.el should be very
+useful, and explain clearly how to use the code, some explanations for
+more advanced functionalities could be a little outdated
+(contributions are very welcome. The thread [[https://lists.gnu.org/archive/html/emacs-orgmode/2015-09/msg00487.html][here]] may contain some
+extra useful information, although most of the suggestions provided by
+Eric should have been implemented). If some of the instructions are
+not clear, then here follow some suggestion for how to approach
+'uncertainties':
+
+- start with instrumenting [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html][see edebug]] the =org-babel-execute:template=
+  function, and subsequently evaluate some test-code block. In this way you
+  can easily figure out how org-babel processes header arguments. Then in
+  the end, the result printed by a code block simply consists of the output
+  of that function.
+- The trick is to process the vars/result-params and the =full=body=
+  variable (~let~ form within =org-babel-execute:template= function) and
+  send the appropriate lines to some inferior process (or as an argument to
+  some shell command). The inferior process can be created in the function
+  =org-babel-template-initiate-session=. The result returned by the inferior
+  process (or by the shell command), should be returned by
+  =org-babel-execute:template= (of course you might further process it
+  before you return it).
+- Don't forget to read the comments in the ob-template file, e.g. for
+  sending/receiving output to/from an inferior process, the functions in
+  =org-babel-comint= might be useful, etc...
+
+
 * Footnotes
 
 [fn:1] If you want to load a language in the =contrib= directory by
diff --git a/org-contrib/babel/ob-template.el b/org-contrib/babel/ob-template.el
index 7c3fbb0d..87afb3dc 100644
--- a/org-contrib/babel/ob-template.el
+++ b/org-contrib/babel/ob-template.el
@@ -26,12 +26,32 @@
 
 ;;; Commentary:
 
-;; This file is not intended to ever be loaded by org-babel, rather it
-;; is a template for use in adding new language support to Org-babel.
-;; Good first steps are to copy this file to a file named by the
-;; language you are adding, and then use `query-replace' to replace
-;; all strings of "template" in this file with the name of your new
-;; language.
+;; This file is not intended to ever be loaded by org-babel, rather it is a
+;; template for use in adding new language support to Org-babel. Good first
+;; steps are to copy this file to a file named by the language you are adding,
+;; and then use `query-replace' to replace all strings of "template" in this
+;; file with the name of your new language.
+
+;; After the `query-replace' step, it is recommended to load the file and
+;; register it to org-babel either via the customize menu, or by evaluating the
+;; line: (add-to-list 'org-babel-load-languages '(template . t)) where
+;; `template' should have been replaced by the name of the language you are
+;; implementing (note that this applies to all occurrences of 'template' in this
+;; file).
+
+;; After that continue by creating a simple code block that looks like e.g.
+;;
+;; #+begin_src template
+
+;; test
+
+;; #+end_src
+
+;; Finally you can use `edebug' to instrumentalize
+;; `org-babel-expand-body:template' and continue to evaluate the code block. You
+;; try to add header keywords and change the body of the code block and
+;; reevaluate the code block to observe how things get handled.
+
 ;;
 ;; If you have questions as to any of the portions of the file defined
 ;; below please look to existing language support for guidance.
@@ -43,6 +63,7 @@
 ;; of Org-mode, otherwise unassigned language support files can still
 ;; be included in the contrib/ directory of the Org-mode repository.
 
+
 ;;; Requirements:
 
 ;; Use this section to list the requirements of this language.  Most
@@ -63,19 +84,22 @@
 ;; optionally declare default header arguments for this language
 (defvar org-babel-default-header-args:template '())
 
-;; This function expands the body of a source code block by doing
-;; things like prepending argument definitions to the body, it should
-;; be called by the `org-babel-execute:template' function below.
+;; This function expands the body of a source code block by doing things like
+;; prepending argument definitions to the body, it should be called by the
+;; `org-babel-execute:template' function below. Variables get concatenated in
+;; the `mapconcat' form, therefore to change the formatting you can edit the
+;; `format' form.
 (defun org-babel-expand-body:template (body params &optional processed-params)
   "Expand BODY according to PARAMS, return the expanded body."
-  (require 'inf-template)
-  (let ((vars (nth 1 (or processed-params (org-babel-process-params params)))))
+  (require 'inf-template nil t)
+  (let ((vars (org-babel--get-vars (or processed-params (org-babel-process-params params)))))
     (concat
      (mapconcat ;; define any variables
       (lambda (pair)
         (format "%s=%S"
                 (car pair) (org-babel-template-var-to-template (cdr pair))))
-      vars "\n") "\n" body "\n")))
+      vars "\n")
+     "\n" body "\n")))
 
 ;; This is the main function which is called to evaluate a code
 ;; block.
@@ -101,13 +125,16 @@
 This function is called by `org-babel-execute-src-block'"
   (message "executing Template source code block")
   (let* ((processed-params (org-babel-process-params params))
-         ;; set the session if the session variable is non-nil
-         (session (org-babel-template-initiate-session (first processed-params)))
+         ;; set the session if the value of the session keyword is not the
+         ;; string `none'
+         (session (unless (string= value "none")
+                   (org-babel-template-initiate-session
+                    (cdr (assq :session processed-params)))))
          ;; variables assigned for use in the block
-         (vars (second processed-params))
-         (result-params (third processed-params))
+         (vars (org-babel--get-vars processed-params))
+         (result-params (assq :result-params processed-params))
          ;; either OUTPUT or VALUE which should behave as described above
-         (result-type (fourth processed-params))
+         (result-type (assq :result-type processed-params))
          ;; expand the body with `org-babel-expand-body:template'
          (full-body (org-babel-expand-body:template
                      body params processed-params)))
-- 
2.31.1


  reply	other threads:[~2021-09-25 21:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 13:33 What's up with ob-template.el? It seems heavily outdated dalanicolai
2021-05-21 13:50 ` Pedro Bruel
2021-05-26 12:07   ` dalanicolai
2021-05-26 12:12     ` dalanicolai
2021-05-27 11:16     ` Nicholas Savage
2021-09-25 14:19 ` Bastien
2021-09-25 21:46   ` dalanicolai [this message]
2021-09-27  8:22     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACJP=3kEup-jornAXPgGP68S8goc5QvHt77fyBnjuuGG3zXGrA@mail.gmail.com' \
    --to=dalanicolai@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).