Python Session changed from Python to Scheme

I’m writing a document where Python sessions are used. Somehow some of these sessions have suddenly changed to Scheme sessions… I don’t know why and how that happened (probably I did something wrong… just learning to use Texmacs) but more importantly how can I force it to be Python sessions again…


(I hope the image does show up in the post). It shows what I see, all the code was working Python code and ran fine (see the plot) but now when I run them again they are excuted as Scheme expressions.
Other sessions containing Python code were not affected.

Thanks in advance for any help
Rein

Hi @RvdB and weclome to the forum.

I do not know why the session changed.

To change it back

  • easiest if possible: issue the undo command (under the Edit menu), as many times as necessary
  • if undo is not possible:

go to the source view (menu Document -> Source -> Edit source tree)

you will see the source representation of the session, here is one I generated without any session input:

You have to change the string scheme in slot 0 (session is the tree label, scheme is in slot 0, default in slot 1 and so on) into python.

After this, go back to the default view (using again the Document -> Source -> Edit source tree menu item) and evaluate all fields; evaluation will turn the field flag, that for the Scheme session is Scheme, into the Python session one. There is a context menu item for evaluating all fields (get the context menu with a right click of the mouse while inside a session, then Evaluate -> Evaluate all).

Please let me know if this helps. I got to it empirically but it looks reasonable (TeXmacs documents are text documents, change the text and their behaviour will change) and it worked in my test.

Giovanni

1 Like