MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000682luatexfeature requestpublic2011-06-16 16:162018-02-25 17:09
ReporterTaco 
Assigned ToHans Hagen 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target Versionmaybe never (> v 1)Fixed in Version1.10.0 
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 [^]
(0001686)
Hans Hagen (manager)
2018-02-25 17:09

too complex without pproper managemt of the run (interferences) but already possible by tail calls back into lua apart from potential nesting levels overflow; made a bit more convenient with extra helper that quits input (discussed /presented at upcoming ctx meeting)

- 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)
2018-01-25 16:32 Hans Hagen Assigned To => Hans Hagen
2018-02-25 17:09 Hans Hagen Note Added: 0001686
2018-02-25 17:09 Hans Hagen Status assigned => closed
2018-02-25 17:09 Hans Hagen Resolution open => no change required
2018-02-25 17:09 Hans Hagen Fixed in Version => 1.10.0


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker