[dev-context] x-set-11.mkiv

Wolfgang Schuster schuster.wolfgang at googlemail.com
Thu Apr 7 15:37:35 CEST 2011


Hi Hans,

there are two \enabblemode’s missing.

\startxmlsetups xml:setups:typeset
    \getvalue{\e!start setuptext}
        \tttf
        \nohyphens
        \veryraggedright
        \doglobal\newcounter\currentSETUPargument
        \xdef\maximumSETUPargument{\xmlcount{#1}{/arguments/*}}
        \bgroup
+           \enablemode[setups-pass-one]
            \doif {\xmlatt{#1}{generated}} {yes} {
                \ttsl
            }
            \doifelse {\xmlatt{#1}{type}} {environment} {
                \tex{\e!start}
            } {
                \tex{}
            }
            \xmlfilter{#1}{/sequence/first()}
            \ignorespaces
        \egroup
        \xmldoif{#1}{/arguments} {
            \bgroup
+               \enablemode[setups-pass-one]
                \doglobal\newcounter\currentSETUPargument
                \ignorespaces
                \xmlfilter{#1}{/arguments/text()}
            \egroup
        }
        \doif {\xmlatt{#1}{type}} {environment} {
            \bgroup
                \enablemode[setups-pass-one]
                \hskip.5em\unknown\hskip.5em
                \doif {\xmlatt{#1}{generated}} {yes} {
                    \ttsl
                }
                \tex{\e!stop}
                \xmlfilter{#1}{/sequence/first()}
                \ignorespaces
            \egroup
        }
        \endgraf
        \xmldoif{#1}{/arguments} {
            \bgroup
                \enablemode[setups-pass-two]
                \doglobal\newcounter\currentSETUPargument
                \blank[\v!line]
                \switchtobodyfont[small]
                \ignorespaces\xmlfilter{#1}{/arguments/text()}\endgraf
            \egroup
        }
    \getvalue{\e!stop setuptext}
\stopxmlsetups


What’s also missing is support for the “generated” and “variant” attributes, the code below doesn’t work but it shows what is missing.

%\def\showsetupindeed#1%
%  {\xmlfilterlist{\loadedsetups}{/interface/command['#1' == (@type=='environment' and 'start' or '') .. @name]/command(xml:setups:typeset)}}

\def\showsetupindeed#1%
  {\xmlfilterlist{\loadedsetups}{/interface/command['#1' == (@type=='environment' and 'start' or '') .. @name .. (@generated=='yes' and '*' or '') .. (@variant~='' and ':@variant' or '')]/command(xml:setups:typeset)}}


<cd:command name="framedtext">                                            -> \showsetups{framedtext}
<cd:command name="framedtext"  type="environment">                        -> \showsetups{startframedtext}
<cd:command name="framedtext" generated="yes">                            -> \showsetups{framedtext*}
<cd:command name="framedtext" type="environment" generated="yes">         -> \showsetups{startframedtext*}
<cd:command name="interlinespace" variant="1">                            -> \showsetups{setupinterlinespace:1}
<cd:command name="typing" type="environment" generated="yes" variant="1"> -> \showsetups{starttyping*:1}


Wolfgang



More information about the dev-context mailing list