texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Octave plugin


From: Andrea Gamba
Subject: Re: [Texmacs-dev] Octave plugin
Date: Sat, 02 May 2009 19:14:10 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Joris van der Hoeven wrote:
Dear Andrea,

If I understand well, you are just proposing to uncomment all references to 
gset.
Do you know if there is a way to test the version of octave and execute the code
only for older version. In that way, we remain backward compatible.

Thanks, Joris
So here it is: a clean way to remain backward compatible is to copy

cp -r TeXmacs/plugins/octave/octave/ TeXmacs/plugins/octave/octave29/

and use the attached (modified) versions of

TeXmacs/bin/tm_octave
TeXmacs/plugins/octave/octave29/.octaverc
TeXmacs/plugins/octave/octave29/tm-start.oct
TeXmacs/plugins/octave/octave29/tm/tmrepl.m

Andrea






#!/bin/sh
echo -ne "\002verbatim:";
octave -v;
new=`octave -q --eval 'exist ("OCTAVE_VERSION") == 5' | awk '{print $3;}'`
if [ $new -eq 1 ]
then
   cd $TEXMACS_PATH/plugins/octave/octave29
else
   cd $TEXMACS_PATH/plugins/octave/octave
fi
exec octave -qi tm-start.oct

d=[getenv("TEXMACS_PATH"),"/plugins/octave/octave29"];
if (length(d) > 0)
        addpath([d,"/tm:"],[d,"/plot:"],[d,"/polynomial:"]);
   PS1("\\002channel:prompt\\005octave> \\005");
   PS2("\\002channel:prompt\\005> \\005");
   global TMSTRUCT=0;
   global TMCOLORS=["black"; "red"; "magenta"; "orange"; "green"; "blue";];     
    global TMCOLIDX=6;
        tmrepl
endif
d=[getenv("TEXMACS_PATH"),"/plugins/octave/octave29"];
if (length(d) > 0)
        addpath([d,"/tm:"],[d,"/plot:"],[d,"/polynomial:"]);
   PS1("\\002channel:prompt\\005octave> \\005");
   PS2("\\002channel:prompt\\005> \\005");
   global TMSTRUCT=0;
   global TMCOLORS=["black"; "red"; "magenta"; "orange"; "green"; "blue";];     
    global TMCOLIDX=6;
        tmrepl
endif
function tmrepl()
        prompt=sprintf("%cchannel:prompt%coctave> %c",2,5,5);
        r=input(prompt, "s");
        answer="texmacs";
        while ( 1 )
                if r(length(r))!=";"
                        dispans=1;
                else
                        dispans=0;
                endif
                r=sprintf("%ctexmacs%c; %s;",39,39,r);
                answer=eval(r,"tmlasterr");
                if dispans & isnewans(answer)
                        tmdisp(answer);
                endif
                r=input(prompt,'s');
        endwhile
endfunction

reply via email to

[Prev in Thread] Current Thread [Next in Thread]