ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* What is preloaded by “mtxrun --script”?
@ 2011-02-16 22:44 Philipp Gesang
  2011-02-16 22:59 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Gesang @ 2011-02-16 22:44 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1498 bytes --]

Hi all,

I noticed that although mtxrun preloads some of the context libs
that doesn’t cover everything available during an ordinary mkiv
run.  What would be the canonical way to load additional libs
like “luat-ini” &c. on demand? “environment.loadluafile()”? Can
this be configured globally? Is it wise to mess with “own.libs”
in mtxrun?

Example: This snippet checks the global env for some tables.
“mtxrun --script” doesn’t find any while some of them are there
when processed as cld.

···8<····························································

-- http://www.ntg.nl/pipermail/ntg-context/2010/054982.html
local testme = {
    "userdata", "thirddata", "moduledata", "documentdata", "parametersets",
    --"document"
}

for _,item in next, testme do
    local i = _G[item]
    if i then
        print(item, table.serialize(i))
    else
        print(item, "Nope!")
    end
end

-- Comprehensive:
--for _,k in next,table.sortedkeys(_G) do
    --print(k,_G[k])
--end

···8<····························································

(My issue is that I’m testing the lua internals of module code
without having to startup the whole big typesetting environment.
Would be much easier if everything normally accessible from
inside an mkiv session was there as well.)

Thanks for any insights, Philipp

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  What is preloaded by “mtxrun --script”?
  2011-02-16 22:44 What is preloaded by “mtxrun --script”? Philipp Gesang
@ 2011-02-16 22:59 ` Hans Hagen
  2011-02-17  9:52   ` Philipp Gesang
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-02-16 22:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Philipp Gesang

On 16-2-2011 11:44, Philipp Gesang wrote:
> Hi all,
>
> I noticed that although mtxrun preloads some of the context libs
> that doesn’t cover everything available during an ordinary mkiv
> run.  What would be the canonical way to load additional libs
> like “luat-ini”&c. on demand? “environment.loadluafile()”? Can
> this be configured globally? Is it wise to mess with “own.libs”
> in mtxrun?
>
> Example: This snippet checks the global env for some tables.
> “mtxrun --script” doesn’t find any while some of them are there
> when processed as cld.

something

dofile(resolvers.findfile("yourfile.lua"))

but keep in mind that most of the mkiv code depends on other code and 
often they depend on functionality that is only available when we're in 
luatex mode and not in texlua mode

Hans

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  What is preloaded by “mtxrun --script”?
  2011-02-16 22:59 ` Hans Hagen
@ 2011-02-17  9:52   ` Philipp Gesang
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Gesang @ 2011-02-17  9:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1376 bytes --]

On 2011-02-16 <23:59:15>, Hans Hagen wrote:
> On 16-2-2011 11:44, Philipp Gesang wrote:
> >Hi all,
> >
> >I noticed that although mtxrun preloads some of the context libs
> >that doesn’t cover everything available during an ordinary mkiv
> >run.  What would be the canonical way to load additional libs
> >like “luat-ini”&c. on demand? “environment.loadluafile()”? Can
> >this be configured globally? Is it wise to mess with “own.libs”
> >in mtxrun?
> >
> >Example: This snippet checks the global env for some tables.
> >“mtxrun --script” doesn’t find any while some of them are there
> >when processed as cld.
> 
> something
> 
> dofile(resolvers.findfile("yourfile.lua"))
> 
> but keep in mind that most of the mkiv code depends on other code
> and often they depend on functionality that is only available when
> we're in luatex mode and not in texlua mode

In this case there were two deps. I extracted the order in which
the libs are loaded by context and put it on the wiki. This isn’t a
*real* dependency tree but still it can be of help when
troubleshooting similar issues. 
<http://wiki.contextgarden.net/Running_Lua_Code_Externally#Standard_library_loading_order>

Thanks for the pointer, Philipp

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-17  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-16 22:44 What is preloaded by “mtxrun --script”? Philipp Gesang
2011-02-16 22:59 ` Hans Hagen
2011-02-17  9:52   ` Philipp Gesang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).