···<date: 2012-10-02, Tuesday>···<from: Andre Caldas>···

> >     function document.MyCharacterMess(str,filename)
> 
> What is this "str"?

The raw file content as a Lua string. You can examine the
arguments you get like so:

·······································································
\startluacode
  document.arg_test = function (s, ...)
    table.print({...}, "file_content")
    return s
  end

  local textfileactions = resolvers.openers.helpers.textfileactions
  
utilities.sequencers.appendaction(textfileactions,"system","document.arg_test")
\stopluacode

\starttext
  \input ward
  \input knuth
\stoptext
·······································································


> >         if file.nameonly(filename) == "ward" then
> >             str = table.concat(string.totable(str,"."), " + ")
> 
> What is this doing?

Split the input at every byte and re-concatenate using "+" as
delimiter. (It’s a bit confusing as string.totable() takes only
one argument ;-) )
 
> > [...]
> > utilities.sequencers.appendaction(textfileactions,
> > "system","document.MyCharacterMess")
> 
> Why is "document.MyCharacterMess" a string?

The sequencers use loadstring() internally (util-seq.lua), so you
need to supply the namespace as a string. This happens all over
the place with action/callbacks.

Regards
Philipp

Attachment: pgpBZAUsa1Tuq.pgp
Description: PGP signature

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to