texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] New special env variable: path to self


From: Lionel Elie Mamane
Subject: [Texmacs-dev] New special env variable: path to self
Date: Thu, 26 Oct 2006 10:23:17 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Tue, Oct 24, 2006 at 02:40:35PM +0200, Lionel Elie Mamane wrote:

> For my Coq TeXmacs plugin, I would like to programmatically decide the
> colour of the prompt in a session.

That is, depending on the position in the document.

> I have thus put this definition in the session/coq style:

>   <assign|coq-orig-input|<value|input>>

>   
> <assign|input|<macro|prompt|body|<coq-orig-input|<with|color|<if|<equal|<value|prog-language>|coq>|<extern|coq-prompt-colour>|<value|color>>|<arg|prompt>>|<arg|body>>>>

> where coq-prompt-colour is a secure Scheme procedure that will return
> the colour the thing should be in.

The problem is that as far as I can determine, there is no way for
that scheme procedure to know the position in the document of the node
being typeset. I thus propose the following:

  add an environmental variable "self" or "self-path" that evaluates
  to the path of the <value> node that asks it value. That is
  <value|self> would evaluate to (a suitable encoding) of the path to
  the value node.

I could then change the code above by replacing

 <extern|coq-prompt-colour>

by

 <extern|coq-prompt-colour|<value|self>>

and the coq-prompt-colour scheme procedure would get the information
it needs as argument.


Would you willing to take a patch for that? I have one nearly ready
waiting, it works for me, I just have to clean it up before
submission. What I did is change bridge_compound_rep::my_typeset and
edit_env_rep::exec_value to hard-code recognise the special value name
"self" and then return the ip (path in reversed order) of the tree
being currently typeset/executed instead of doing a lookup in env.


Would you be willing to accept such a patch for TeXmacs? Would you
want it done in another manner?


-- 
Lionel




reply via email to

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