texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] questions about sessions -- The session prompt issue


From: David E. Miller
Subject: Re: [Texmacs-dev] questions about sessions -- The session prompt issue
Date: Sun, 19 May 2013 11:39:09 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

Andrey:

I looked into this once. This Is what I found -- I think:

It appears that TeXmacs takes the prompt automatically from the session name in one of the Scheme plugin init files, or if not, from some other source by default.

However, it appears you can modify this behavior. Look in the example plugin folder. I am not sure which OS you are using so you will have to find this folder on your system. It should be in a folder named plugins but not in the one with the bin folder that has all the tm_* plugin files. It is the plugin folder with all the Scheme plugin code. In the example folder there is a folder with prompt cpp source code and a makefile. You can edit the cpp code and use the makefile to compile a binary. This binary file has be located in your plugin folder in the bin folder. I think that TeXmacs looks for this file when the plugin session is started and if it exists, the prompt of this binary file is executed and the default plugin prompt is not used.

You will also have to edit the file init-.scm file for your plugin it appears. The default name of the prompt bin file is "prompt.bin". You may have to change that also to match the prompt name you choose, e.g., python-prompt.bin. The init-prompt.scm example file is an outline of what must be included. This is a minimal Scheme plugin init file. the contents really should be part of the the main Scheme init file for your plugin I believe. The "prompt.bin" binary file has to be located within your plugin bin folder as I recall.

I have not tried this myself, but it should not take too much effort to give this a try.

If this does not work, sorry! This is all I know about the issue and I am not an expert. My recollection is that the TeXmacs help has some detailed info on this subject.

On my GNU/Linux system the example folder is: /usr/share/texmacs/TeXmacs/examples/plugins/prompt

Hope this helps:

David Miller

On 5/19/2013 7:26 AM, address@hidden wrote:
Hello *,

A few stupid questions, sorry.

1. Many plugins have files
.../plugins/foo/packages/session/foo.ts
which define foo-prompt, foo-input, foo-output (or a subset thereof). I suppose this foo.ts is automatically loaded when starting a foo session, right? Are these macros somehow used automatically by the session?

I experimented a bit and found that, if I define a foo-prompt macro, I can use it via

[02]prompt#[02]scheme:(foo-prompt "my_prompt")[05][05]

(in pnambic notation; [02] and [05] are DATA_BEGIN and DATA_END).
Is there a simpler way?

2. In most plugins, definitions of foo-input and foo-output contain generic-input and generic-output. What are they?

3. What foo-input (having 2 parameters: prompt and body) is supposed to do?

What I want is to do minimal modification to foo CAS, so that instead of
<prompt>
it prints
<prompt_prefix> <prompt> <prompt_suffix>
(where, of course, <prompt_prefix> contains [02] and other stuff, and <prompt_suffix> contains [05]). These prefix and suffix should be short and generic; all typesetting information (prompt color, font, etc.) should be not in the CAS code, but in the style file foo.ts. Then it's much easier to modify such detains. The shortest way I found so far is, as I said,

<prompt_prefix> = [02]prompt#[02]scheme:(foo-prompt "
<prompt_suffix> = ")[05][05]

Is there anything better and shorter?

The same goes for input and output - their color etc. should be in foo.ts, not in the CAS code which produces this output. Right?

Thanks in advance,
Andrey

_______________________________________________
Texmacs-dev mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/texmacs-dev





reply via email to

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