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: Tue, 28 Apr 2009 00:13:53 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

I tried to make the plugin compatible with both the new and the old version but I am stuck with some strange behavior of Octave which I don't understand.

According to
http://www.gnu.org/software/octave/NEWS-3.html
a solution could be to rename as "tmrepl3.m" the modified tmrepl.m, leave the old tmrepl.m unchanged, and write in .octaverc and tm-start.oct:


d=getenv("TEXMACS_PATH");
v3=(exist ("OCTAVE_VERSION") == 5)
if (length(d) > 0)
  if v3
addpath([d,"/plugins/octave/octave/tm"],[d,"/plugins/octave/octave/plot"],[d,"/plugins/octave/octave/polynomial"]);
     PS1("\\002channel:prompt\\005octave> \\005");
     PS2("\\002channel:prompt\\005> \\005");
  else
LOADPATH=[[d,"/plugins/octave/octave/tm:"],[d,"/plugins/octave/octave/plot:"],[d,"/plugins/octave/octave/polynomial:"],LOADPATH];
     PS1="\\002channel:prompt\\005octave> \\005";
     PS2="\\002channel:prompt\\005> \\005";
  endif
  global TMSTRUCT=0;
  global TMCOLORS=["black"; "red"; "magenta"; "orange"; "green"; "blue";];
  global TMCOLIDX=6;
  if !v3
     gset terminal postscript eps enhanced color;
     gset size 0.5,0.5;
  endif
  if v3
     tmrepl3
  else
     tmrepl
  endif
endif


This should work, but in practice the "if" clause seems to be not executed correctly by Octave 3.0 (I get LOADPATH= executed although v3=1). I don't know what can be done.

Andrea





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






reply via email to

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