- From: Enrique Perez-Terron <address@hidden>
- To: address@hidden
- Subject: Re: [TeXmacs] Continue enumeration
- Date: Tue, 14 Oct 2008 04:14:46 +0200
On Mon, 2008-10-13 at 10:37 +0200, Benno Dielmann wrote:
>
That's what flags are for... Look:
>
>
<assign|list-save-state|\
>
<macro|label|\
>
<flag|list-save-state|orange>\
>
<quasi|\
>
<assign|<unquote|<arg|label>>|\
>
<value|item-nr>\
>
>>>>
>
<assign|list-restore-state|\
>
<macro|label|\
>
<flag|list-restore-state|orange>\
>
<assign|item-nr|\
>
<value|<arg|label>>\
>
>>>
>
>
Now you get flags displayed where you entered the macros (assuming you
>
switched them on in Document->View->Informative Flags)
>
>
I chose orange as flag color; you can choose any other color.
I incorporated flags as per your proposal, and added code to make the
flag text contain the label. It turns out that the <flag> primitive
wants the first argument to be a single string node, so I again had to
play games with quasi, unquote, and merge. This is the contents of my
list-save-state.ts:
<TeXmacs|1.0.6.15>
<style|source>
<\body>
<assign|list-save-state|<macro|mylabel|<quasi|<assign|<unquote|<merge|list-saved-|<arg|mylabel>>>|<value|item-nr>><flag|<unquote|<merge|list-save-state:|<arg|mylabel>>>|orange>>>>
<assign|list-restore-state|<macro|mylabel|<assign|item-nr|<value|<merge|list-saved-|<arg|mylabel>>>><quasi|<flag|<unquote|<merge|list-restore-state:|<arg|mylabel>>>|orange>>>>
</body>
<\initial>
<\collection>
<associate|src-compact|none>
</collection>
</initial>
Or, with broken lines:
<assign|list-save-state|\
<macro|mylabel|\
<quasi|\
<assign|\
<unquote|<merge|list-saved-|<arg|mylabel>>>|\
<value|item-nr>>\
<flag|\
<unquote|<merge|list-save-state:|<arg|mylabel>>>|\
orange>>>>
<assign|list-restore-state|\
<macro|mylabel|\
<assign|\
item-nr|\
<value|<merge|list-saved-|<arg|mylabel>>>>
<quasi|\
<flag|\
<unquote|<merge|list-restore-state:|<arg|mylabel>>>|\
orange>>>>
Regards,
Enrique
Archive powered by MHonArc 2.6.19.