I made some progress with tab-stops using these macros which descended the document tree counting characters as it went; however although it worked for simple strings and <nf-tab> nodes, it started to fail badly with weird errors. Debugging (which has been added below) shows that nf-line-render which calls nf-line-concat starts finding nodes like "with" and "locus" - clearly I didn't want to see those, I just want to get the rendered strings so that I can count the characters.

I'm wondering if implementation of tab-stops should go in the C code just above the syntax highlighting level, but maybe someone has one last hint here?

<assign|nf-tab-stop|8>

<assign|nf-tab|<macro|<resize|<with|mode|math|\<mapsto\>>|||<merge|l+|<minus|<value|nf-tab-stop>|<mod|<value|nf-len>|<value|nf-tab-stop>>>|spc>|>>>


<assign|nf-line-string|<macro|x|[STRING:(<value|nf-len>)=<arg|x><assign|nf-len|<plus|<value|nf-len>|<length|<arg|x>>>>;<value|nf-len>]>>

<assign|nf-line-concat|<macro|x|<with|end|<get-arity|<arg|x>>|i|0|<if|<greater|<value|end>|0>|[CONCAT;<while|<less|<value|i>|<value|end>>|[i=<value|i>\<less\><value|end>]{{{<get-label|<look-up|<arg|x>|<value|i>>>}}}<nf-render-tags|<look-up|<arg|x>|<value|i>>><assign|i|<plus|<value|i>|1>>>;EC]|\<less\>\<less\><get-label|<arg|x>>\<gtr\>\<gtr\><arg|x>>>>>

<assign|nf-render-tags|<macro|x|<case|<equal|<get-label|<arg|x>>|string>|<nf-line-string|<arg|x>>|<equal|<get-label|<arg|x>>|concat>|XXXX<nf-line-concat|<arg|x>>|{<get-label|<arg|x>>}<arg|x>>>>

<assign|itemly|<macro|x|<item><assign|the-label|<value|the-chunk-label>
<localize|line> <item-nr>><with|nf-len|0|<arg|x>>>>
--
[FSF
          Associate Member #2325]
_______________________________________________
Texmacs-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/texmacs-dev

Reply via email to