This is an org-babel extension that integrates the FriCAS computer
algebra system into org-mode, allowing a literate development &
presentation style with easy publishing to HTML, PDF, etc.  It
requires the ``frimacs'' package also to be installed.

See the ``Working with source code'' chapter of the Org manual for
details on using org-babel functionality in Org files.

To enable this extension put

 (require 'ob-fricas)

in your ~/.emacs initialisation file.

There are two language names defined in this extension: ``fricas''
and ``spad''.  The first is for running arbitrary code in the
FriCAS REPL, and corresponds to ``frimacs-input-mode''.  The second
is for embedding SPAD source code blocks into an Org document, and
corresponds to ``frimacs-spad-mode''.

Actually there is also a third: ``axiom'' -- this is a synonym for
``fricas'' and is defined for backward compatibility with the
ob-axiom package.

The default behaviour of ``fricas'' (and thus ``axiom'') source
code blocks in ob-fricas is that of ``:results output'' mode,
i.e. scripting mode in the terminology of the Org manual.  If this
is unfamiliar to you, see the ``Header arguments'' section of the
``Working with source code'' chapter in the Org manual for more
information on what this means.  By default, all of the input line
to FriCAS, including the prompt, as well as the output generated by
FriCAS, is echoed in the output captured by Org.  To change this
use the extra header options explained below.

There are three extra header options (non-standard org-babel options)
for ``#+BEGIN_SRC fricas'' source code blocks:-

  :block-read <yes/no/auto>  (defaults to auto)
  :show-prompt <yes/no>      (defaults to yes)
  :show-input <yes/no>       (defaults to yes)

The block-read option forces ob-fricas to send the entire code block
to the running FriCAS process via a temporary file.  This allows
``pile mode'' source code to be handled correctly.  Otherwise
ob-fricas sends each line of the code block individually to the
FriCAS process for interpretation.

The show-prompt option allows to enable or inhibit the display of
the FriCAS REPL prompt on a block-by-block basis.

The show-input option allows to enable or inhibit the display of
the FriCAS input command/source on a block-by-block basis.

Finally, a useful tip for FriCAS.  If you want to suppress the
numbering of prompts and output results that FriCAS normally
generates, put the following at the start of your Org file:-

#+BEGIN_SRC fricas :results silent :exports none
)set message prompt plain
)boot $IOindex := nil
#+END_SRC