MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000682luatexfeature requestpublic2011-06-16 16:162015-11-11 11:52
ReporterTaco 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Versionmaybe never (> v 1)Fixed in Version 
Summary0000682: Create tex.execute()
DescriptionSyntax as for tex.print(), but executed immediately, and including a potential errors when used in a non-expandable context.

This is mostly *needed* because coroutines will be different and less powerful in lua 5.2, but besides that it would also be very useful, in all sorts of cases.
Steps To Reproduceit will probably be a mess and still not always ok ... one can do this already:

\directlua {

tex.directprinter = nil

function tex.directprint(...)
    tex.print(...)
    tex.print("\\directlua{coroutine.resume(tex.directprinter)}")
    coroutine.yield()
end

function tex.directsprint(...)
    tex.sprint(...)
    tex.sprint("\\directlua{coroutine.resume(tex.directprinter)}")
    coroutine.yield()
end

function stepwise(f)
    tex.directprinter = coroutine.create(f)
    coroutine.resume(tex.directprinter)
end

}

test

\directlua {
    stepwise (function()
        tex.directprint("\\setbox0\\hbox{!!!!}")
        tex.directprint(tex.getbox(0).width .. "\\par")
        tex.directprint("\\setbox2\\hbox{????}")
        tex.directprint(tex.getbox(2).width .. "\\par")
        tex.directprint("\\copy0\\copy2\par")
        stepwise (function()
            tex.directprint("\\bgroup")
            tex.directprint("\\setbox0\\hbox{>>>>}")
            tex.directprint(tex.getbox(0).width .. "\\par")
            tex.directprint("\\setbox2\\hbox{<<<<}")
            tex.directprint(tex.getbox(2).width .. "\\par")
            tex.directprint("\\copy0\\copy2\par")
            tex.directprint("\\copy0\\copy2\par")
            tex.directprint("\\egroup")
        end)
        tex.directprint("\\copy0\\copy2\par")
    end)
}

test
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000919)
oneiros (developer)
2012-01-15 23:34

See also the discussion at http://tex.stackexchange.com/q/20893/5763 [^]

- Issue History
Date Modified Username Field Change
2011-06-16 16:16 Taco New Issue
2012-01-15 23:34 oneiros Note Added: 0000919
2012-08-10 15:45 oneiros Severity minor => feature
2015-11-08 16:45 Hans Hagen Product Version => maybe never (> v 1)
2015-11-08 16:45 Hans Hagen Steps to Reproduce Updated View Revisions
2015-11-08 16:45 Hans Hagen Status new => acknowledged
2015-11-08 16:46 Hans Hagen Status acknowledged => assigned
2015-11-11 11:52 Hans Hagen Product Version maybe never (> v 1) =>
2015-11-11 11:52 Hans Hagen Target Version => maybe never (> v 1)


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker