[NTG-context] \e!start in lua

Hans Hagen pragma at wxs.nl
Sun Jan 16 17:08:42 CET 2011


On 15-1-2011 11:57, Aditya Mahajan wrote:
> What is the best way to define the equivalent of
>
> \setvalue{\e!start\NAME}{...}
>
> in lua.
>
> e_start = ??
> context.setvalue(e_start .. name, "...")

\starttext

\startluacode

local elements  = interfaces.complete.elements
local interface = storage.shared.currentinterface

local e_start = elements.start[currentinterface]
local e_stop  = elements.stop [currentinterface]

context.setvalue(e_start .. "something", "[[")
context.setvalue(e_stop  .. "something", "]]")

\stopluacode

\startsomething Yes we can!\stopsomething

\stoptext


(i should probably preload elements as well)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list