Am 03.05.2012 um 17:18 schrieb Aditya Mahajan:
On Thu, 3 May 2012, Wolfgang Schuster wrote:
You assume \definelinenumbering has a second argument for the settings but this isn’t the case
D'oh.
and you need \setuplinenumbering to set them.
I also needed to change \setvalue to \setevalue in the example, and add an \expanded to get it to work.
In MkIV \setuevalue is better the \setevalue and \normalunexpanded is faster than \expanded. The problem in your approach is that you can only set the style and color value with \definewhatever where I think it’s better to use \setupwhatever. \unprotect \installnamespace {whatever} \installcommandhandler \????whatever {whatever} \????whatever \appendtoks \definelinenumbering[\currentwhatever]% \to \everydefinewhatever \appendtoks \setuevalue{\e!start\currentwhatever}{\whatever_start[\currentwhatever]}% \setuevalue{\e!stop\currentwhatever }{\whatever_stop }% \to \everydefinewhatever \appendtoks \normalexpanded{\setuplinenumbering [\currentwhatever] [\c!color=\whateverparameter\c!numbercolor, \c!style=\whateverparameter\c!numberstyle]}% \to \everysetupwhatever \unexpanded\def\whatever_start[#1]% {\begingroup \edef\currentwhatever{#1}% \startlinenumbering[\currentwhatever]} \unexpanded\def\whatever_stop {\stoplinenumbering \endgroup} \protect \definewhatever[testing][numbercolor=red,numberstyle=bold] \setupwhatever [testing][numbercolor=blue] \starttext \starttesting \input knuth \stoptesting \stoptext Wolfgang