mailing-list for TeXmacs Users

Text archives Help


Forcing refresh of rendering of a document fragment


Chronological Thread 
  • From: Lionel Elie Mamane <address@hidden>
  • To: address@hidden
  • Subject: Forcing refresh of rendering of a document fragment
  • Date: Tue, 24 Oct 2006 14:40:35 +0200

Hi,


Short version: How does one force refreshing the rendering of a
document fragment from Scheme code, short of doing an edit action at
that point or near?

Long version:

For my Coq TeXmacs plugin, I would like to programmatically decide the
colour of the prompt in a session. 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. This nearly works, but:

- the rendering is not refreshed automatically, except when an edit
event happens near the affected node. I'm willing to explicitly
refresh the rendering when needed, but what Scheme procedure shall
I call to do that? The best would be a procedure that takes a tree
or a path and refreshed the rendering of that tree.

- When I take the menu entry "Tools/Update/Styles", it puts all
prompts in one colour and not each prompt in the colour it should
have.

(If the following code would work better, I can also use it:


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

the end result I'm aiming at is rather simple: before a certain point
in the document, all prompts are one colour and after that point all
prompts are another colour. If you see a better way to do it, I'm open
to suggestions. That point is transient, depending on the state of the
Coq process and should _not_ be saved with the document. It is
currently in a Scheme variable (as a position).

)


Any clean/easy way to do that?

--
Lionel



Archive powered by MHonArc 2.6.19.

Top of page