Comment 12 for bug 58498

idavidmiller (david-miller) wrote :

Texmacs sessions for both Maxima and Octave plug-ins are broken and
files of both require some modifications to work at all. There may be more.

System facts:

Ubuntu Linux (Xubuntu) Release 7.10 (gutsy)

GNU/Linux 2.6.22-14-generic kernel

GNU Texmacs, version 1.0.6.10

Maxima 5.12.0
GNU Octave, version 2.1.73

Maxima:

Ubuntu is based on Debian. In Debian, /bin/sh is not a link
to /bin/bash. Instead /bin/sh is linked to but /bin/dash.
Consequently all shell scripts that reference #!/bin/sh are using
/bin/dash and not /bin/bash. This causes some scripts to fail.
Texmacs plug-in scripts are affected by this side effect and in particular
it is certain that the plug-in for Maxima is affected in this way.

Below are some files that may be affected in /usr/lib/texmacs/TeXmacs/bin:

./tm_xypic #!/bin/sh
./tm_dratex #!/bin/sh
./tm_gnuplot #!/bin/sh
./tm_eukleides #!/bin/sh
./tm_lush #!/bin/sh
./tm_matlab #!/bin/sh
./tm_lisp #!/bin/sh
./tm_maple #!/bin/sh
./tm_maxima #!/bin/bash
./fig2ps #!/bin/sh
./tm_mathematica #!/bin/sh
./r_install #!/bin/sh
./tm_gs #!/bin/sh
./maxima_detect #!/bin/bash
./tm_octave #!/bin/bash

These files may not work properly to start a Texmacs session
unless #!/bin/sh is changed to #!/bin/bash. Maxima is one of those that require
this change or the session will not work in Texmacs.

The scripts maxima_detect and tm_maxima both require this change.

Alternatively, /bin/sh may be linked to /bin/bash. However, there may be unknown
side effects elsewhere if /sh/dash is not used possibly. Should not be, but who knows.
In any case this change affects the entire operation system wherever /bin/sh is
referenced.

Octave:

The same comment for a Maxima session applies to Octave.
The script tm_octave requires this same change from #!/bin/sh to #!/bin/bash

In addition, there are changes to the syntax of Octave 2.1 that require changes
to some other files or error and warnings appear during the Texmacs Octave session.

Specifically the files tm-start and .octaverc in /usr/share/texmacs/TeXmacs/plugins/octave/octave
must be changed so that calls to gset are made to __gnuplot_set__ instead. The command gset
has been deprecated (as well as some others) in Octave and __gnuplot_set__ must be used
instead. The gset command appears on lines 8 and 9 in these two files and must be changed.

This change will prevent warnings and/or errors when a Texmacs Octave v2.1 session is started.
However, there are more issues here related to Octave sessions depending on the Octave command
entered. Some commands operate normally without any errors or warnings. Others produce error or
warning messages and may or may not operate as expected. This is because in addition to the
two files listed above there are various other files that are Octave scripts (.m) files in the subdirectories
./plot, ./polynomial, and ./tm of the same /usr/share/texmacs/TeXmacs/plugins/octave/octave directory.

These Octave script files are Octave interface support files for Texmacs. Some (not sure which) of these
files reference deprecated Octave commands and this is what is generating the error/warning messages
for some, but not all, Ocatve commands issued from the Texmacs Octave session. These files will have to be
examined and the offending statements will have to be changed to commands that Octave does not object
to. It is not obvious which files are involved unless you are familiar with the purpose of these .m files and the
relationship they have to Octave commands.

Below is a listing of these files:

./plot
---------------------
contour.m
mesh.m
__plt2mv__.m
__plt2vm__.m
__errplot__.m
__plt2mm__.m
__plt2ss__.m
__plt2vv__.m

./polynomial
--------------------
polyout.m

./tm
-------------------------
isnewans.m
num2scm.m
str2scm.m
struct2tree.m
tmrepl.m
list2scm.m
obj2scm.m
struct2bullet.m
tmdisp.m
mat2scm.m
scheme.m
struct2scm.m
tmlasterr.m

One strategy until this issue is resolved is to try to figure out what is causing the error message and the .m files
involved and edit them to fix the problem by changing offending Octave commands.

A related note for GNU Octave, version 2.9.12. This version of Octave has a number of additional deprecated commands and
statements. The Texmacs Octave plug-in will require some major modifications to accommodate these changes as
well as those in Octave 2.1. Additionally, it seems there will have to be some form of detect (similar to maxima_detect)
to determine which version of Octave is being used so that the correct Octave commands and settings are used in
in the shell script commands as well as in the .m Texmacs Octave interface support files. Until this occurs, it is advisable
to use Octave v2.1.