ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem \input a file (lastest minimals)
@ 2010-11-28 17:52 Procházka Lukáš
  2010-11-28 18:08 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Procházka Lukáš @ 2010-11-28 17:52 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 2914 bytes --]

Hello,

I have a problem to \input a file [in the same directory as the main file is].

This problem started appearing with the latest minimals (updated today evening) and there was no such a problem before.

Try this:

--- main.mkiv

\enableregime[cp1250]

\input{_inc.mkiv}

\starttext
   AAA
\stoptext

---

--- _inc.mkiv

INC.MKIV

---

And the the compilation error:

---

D:\Lukas\ConTeXt\Samples\t-Inc>set PATH=c:\ConTeXt\tex\texmf-mswin\bin;C:\WINDOWS\System32\Wbem;C:\WINDOWS/system32;C:\WINDOWS;D:/Programs/Tcl/bin;C:/gs/gs8.54/bin;C:/Program Files/Common Files/Autodesk Shared/;c:/Program Files/Microsoft SQL Server/90/Tool
s/binn/;C:\Program Files\Lua\5.1;C:\Program Files\Lua\5.1\clibs;C:\adabas\bin;C:\adabas\pgm;D:\Lukas\Bat;D:\Programs.Con;C:\Program Files\Gtk+\bin;;C:\PROGRA~1\COMMON~1\AUTODE~1

D:\Lukas\ConTeXt\Samples\t-Inc>context.exe main.mkiv

MTXrun | run 1: luatex --fmt="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a00c/formats/cont-en" --lua="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a00c/formats/cont-en.lui" --backend=pdf "./ma
in.mkiv"This is LuaTeX, Version beta-0.64.0-2010111223 (rev 3956)
  \write18 enabled.
(main.mkiv

ConTeXt  ver: 2010.11.27 14:27 MKIV  fmt: 2010.11.28  int: english/english

system          : cont-new loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv))
system          : cont-fil.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-fil.mkiv
loading         : ConTeXt File Synonyms
)
system          : cont-sys.rme loaded
(c:/ConTeXt/tex/texmf-context/tex/context/user/cont-sys.rme (c:/ConTeXt/tex/texmf-context/tex/context/base/type-def.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-lua.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-siz.mkiv) (c:/ConTeX
t/tex/texmf-context/tex/context/base/type-otf.mkiv))
system          : cont-err loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-err.tex
systems         : no file 'cont-sys.tex', using 'cont-sys.rme' instead
)
system          : main.top loaded
(main.top){c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
bodyfont        : 12pt rm is loaded
fonts           : preloading latin modern fonts (first stage)
language        : language en is active
! LuaTeX error ...TeXt/tex/texmf-context/tex/context/base/regi-ini.lua:100: attempt to call global 'translate' (a nil value).
<insert>

l.3 \input{_inc.mkiv}

?
! Emergenc^Cy stop.
<
insD:\Lukas\ConTeXt\Samples\t-Inc>ert>

l.3 \input{_inc.mkiv}

!  ==> Fatal error occurred, no output PDF file produced!

D:\Lukas\ConTeXt\Samples\t-Inc>
---

Bug anywhere?

Friendly regards,

Lukas

[-- Attachment #2: _inc.mkiv --]
[-- Type: application/octet-stream, Size: 9 bytes --]

INC.MKIV

[-- Attachment #3: main.log --]
[-- Type: application/octet-stream, Size: 2283 bytes --]

(main.mkiv

ConTeXt  ver: 2010.11.27 14:27 MKIV  fmt: 2010.11.28  int: english/english

system          : cont-new loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv))
system          : cont-fil.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-fil.mkiv
loading         : ConTeXt File Synonyms
)
system          : cont-sys.rme loaded
(c:/ConTeXt/tex/texmf-context/tex/context/user/cont-sys.rme (c:/ConTeXt/tex/texmf-context/tex/context/base/type-def.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-lua.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-siz.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-otf.mkiv))
system          : cont-err loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-err.tex
systems         : no file 'cont-sys.tex', using 'cont-sys.rme' instead
)
system          : main.top loaded
%
%	begin of optionfile
%
%	% runtime options files (command line driven)
%	\unprotect
%	% feedback and basic job control
%	% handy for special styles
%	\startluacode
%	document = document or { }
%	document.arguments={
%	}
%	document.files={
%	 "main.mkiv",
%	}
%	\stopluacode
%	% process info
%	\setupsystem[inputfile=main.mkiv]
%	\setupsystem[\c!n=1,\c!m=1]
%	% modes
%	% options (not that important)
%	\startsetups *runtime:options
%	\setupoutput[pdftex]
%	\stopsetups
%	% styles and modules
%	\startsetups *runtime:modules
%	\stopsetups
%	% done
%	\protect \endinput
%
%	end of optionfile
%
(main.top){c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
bodyfont        : 12pt rm is loaded
fonts           : preloading latin modern fonts (first stage)
language        : language en is active
! LuaTeX error ...TeXt/tex/texmf-context/tex/context/base/regi-ini.lua:100: attempt to call global 'translate' (a nil value).
<insert>  
          
l.3 \input{_inc.mkiv}
                     
? 
! Emergency stop.
<insert>  
          
l.3 \input{_inc.mkiv}
                     
End of file on the terminal!

!  ==> Fatal error occurred, no output PDF file produced!

[-- Attachment #4: main.mkiv --]
[-- Type: application/octet-stream, Size: 69 bytes --]

\enableregime[cp1250]

\input{_inc.mkiv}

\starttext
  AAA
\stoptext

[-- Attachment #5: 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] 5+ messages in thread

* Re: Problem \input a file (lastest minimals)
  2010-11-28 17:52 Problem \input a file (lastest minimals) Procházka Lukáš
@ 2010-11-28 18:08 ` Wolfgang Schuster
  2010-11-28 18:20   ` Hans Hagen
  2010-11-28 22:44   ` Procházka Lukáš
  0 siblings, 2 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2010-11-28 18:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 28.11.2010 um 18:52 schrieb Procházka Lukáš:

> Hello,
> 
> I have a problem to \input a file [in the same directory as the main file is].
> 
> This problem started appearing with the latest minimals (updated today evening) and there was no such a problem before.

regi-ini.lua

  function regimes.process(s)
-     return translate(s,regimes.currentregime)
+     return regimes.translate(s,regimes.currentregime)
  end

The \input command in ConTeXt has no braces, it’s

   \input <file>

or for files with spaces

   \input "<file with spaces>"

Wolfgang

___________________________________________________________________________________
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] 5+ messages in thread

* Re: Problem \input a file (lastest minimals)
  2010-11-28 18:08 ` Wolfgang Schuster
@ 2010-11-28 18:20   ` Hans Hagen
  2010-11-28 22:44   ` Procházka Lukáš
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2010-11-28 18:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 28-11-2010 7:08, Wolfgang Schuster wrote:
>
> Am 28.11.2010 um 18:52 schrieb Procházka Lukáš:
>
>> Hello,
>>
>> I have a problem to \input a file [in the same directory as the main file is].
>>
>> This problem started appearing with the latest minimals (updated today evening) and there was no such a problem before.
>
> regi-ini.lua
>
>    function regimes.process(s)
> -     return translate(s,regimes.currentregime)
> +     return regimes.translate(s,regimes.currentregime)
>    end

fixed

> The \input command in ConTeXt has no braces, it’s
>
>     \input<file>
>
> or for files with spaces
>
>     \input "<file with spaces>"

or \input {<file with spaces>} as luatex supports that natively

-----------------------------------------------------------------
                                           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] 5+ messages in thread

* Re: Problem \input a file (lastest minimals)
  2010-11-28 18:08 ` Wolfgang Schuster
  2010-11-28 18:20   ` Hans Hagen
@ 2010-11-28 22:44   ` Procházka Lukáš
  2010-11-29 14:13     ` Procházka Lukáš Ing. - Pontex s. r. o.
  1 sibling, 1 reply; 5+ messages in thread
From: Procházka Lukáš @ 2010-11-28 22:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]

I patched the 'regi-ini.lua' by your purpose:

---

function regimes.process(s)
     --return translate(s,regimes.currentregime)
print("111", regimes)
print("222", regimes.translate)
     return regimes.translate(s,regimes.currentregime)
end

---

But I'm still getting the same error message! I still have "! LuaTeX error ...TeXt/tex/texmf-context/tex/context/base/regi-ini.lua:100: attempt to call global 'translate' (a nil value).", although I added two "print(...)" before "return regimes...".

The line in the error message is the same: 100 - although the code is shifted three lines bellow.

And - no "111" or "222" appears in the scope during the error message.

- Isn't it weird?

Is there something more I should do? E.g. to delete a Lua cache manually (what dirs/files exactly in this case?).

I also run the "mtxrun --generate" but without success.

You can check the regi-ini.lua attached - it is originally placed in "c:\ConTeXt\tex\texmf-context\tex\context\base\regi-ini.lua".

Lukas


On Sun, 28 Nov 2010 19:08:56 +0100, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

>
> Am 28.11.2010 um 18:52 schrieb Procházka Lukáš:
>
>> Hello,
>>
>> I have a problem to \input a file [in the same directory as the main file is].
>>
>> This problem started appearing with the latest minimals (updated today evening) and there was no such a problem before.
>
> regi-ini.lua
>
>   function regimes.process(s)
> -     return translate(s,regimes.currentregime)
> +     return regimes.translate(s,regimes.currentregime)
>   end
>
> The \input command in ConTeXt has no braces, it’s
>
>    \input <file>
>
> or for files with spaces
>
>    \input "<file with spaces>"
>
> Wolfgang
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>

[-- Attachment #2: regi-ini.lua --]
[-- Type: application/octet-stream, Size: 3400 bytes --]

if not modules then modules = { } end modules ['regi-ini'] = {
    version   = 1.001,
    comment   = "companion to regi-ini.mkiv",
    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
    copyright = "PRAGMA ADE / ConTeXt Development Team",
    license   = "see context related readme files"
}

local utf = unicode.utf8
local char, utfchar, gsub = string.char, utf.char, string.gsub

--[[ldx--
<p>Regimes take care of converting the input characters into
<l n='utf'/> sequences. The conversion tables are loaded at
runtime.</p>
--ldx]]--

regimes          = regimes or { }
local regimes    = regimes

regimes.data     = regimes.data or { }
local data       = regimes.data

regimes.utf      = regimes.utf or { }

regimes.synonyms = regimes.synonyms or { }
local synonyms   = regimes.synonyms

if storage then
    storage.register("regimes/synonyms", synonyms, "regimes.synonyms")
else
    regimes.synonyms = { }
end

-- setmetatable(regimes.data,_empty_table_)

regimes.currentregime = "utf"

--[[ldx--
<p>We will hook regime handling code into the input methods.</p>
--ldx]]--

function regimes.number(n)
    if type(n) == "string" then return tonumber(n,16) else return n end
end

function regimes.setsynonym(synonym,target)
    synonyms[synonym] = target
end

function regimes.truename(regime)
    context((regime and synonyms[synonym] or regime) or regimes.currentregime)
end

function regimes.load(regime)
    regime = synonyms[regime] or regime
    if not data[regime] then
        environment.loadluafile("regi-"..regime, 1.001)
        if data[regime] then
            regimes.utf[regime] = { }
            for k,v in next, data[regime] do
                regimes.utf[regime][char(k)] = utfchar(v)
            end
        end
    end
end

function regimes.translate(line,regime)
    regime = synonyms[regime] or regime
    if regime and line then
        local rur = regimes.utf[regime]
        if rur then
            return (gsub(line,"(.)",rur)) -- () redundant
        end
    end
    return line
end

-- function regimes.enable(regime)
--     regime = synonyms[regime] or regime
--     if data[regime] then
--         regimes.currentregime = regime
--         local translate = regimes.translate
--         resolvers.filters.install('input',function(s)
--             return translate(s,regime)
--         end)
--     else
--         regimes.disable()
--     end
-- end
--
-- function regimes.disable()
--     regimes.currentregime = "utf"
--     resolvers.filters.install('input',nil)
-- end

local sequencers = utilities.sequencers

function regimes.process(s)
    --return translate(s,regimes.currentregime)
print("111", regimes)
print("222", regimes.translate)
    return regimes.translate(s,regimes.currentregime)
end

function regimes.enable(regime)
    regime = synonyms[regime] or regime
    if data[regime] then
        regimes.currentregime = regime
        sequencers.enableaction(resolvers.openers.textfileactions,"regimes.process")
    else
        sequencers.disableaction(resolvers.openers.textfileactions,"regimes.process")
    end
end

function regimes.disable()
    regimes.currentregime = "utf"
    sequencers.disableaction(resolvers.openers.textfileactions,"regimes.process")
end

utilities.sequencers.prependaction(resolvers.openers.textfileactions,"system","regimes.process")
utilities.sequencers.disableaction(resolvers.openers.textfileactions,"regimes.process")

[-- Attachment #3: 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] 5+ messages in thread

* Re: Problem \input a file (lastest minimals)
  2010-11-28 22:44   ` Procházka Lukáš
@ 2010-11-29 14:13     ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 0 replies; 5+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2010-11-29 14:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

... I had to delete the lua-cache manually, the "c:\ConTeXt\tex\texmf-cache\luatex-cache\context\f53042fa2e1c106bc7e3383ec8c3a00c\" directory in my case.

Ctx rebuilt its content and now \input works fine.

Lukas


On Sun, 28 Nov 2010 23:44:17 +0100, Procházka Lukáš <lpr@pontex.cz> wrote:

>
> But I'm still getting the same error message! I still have "! LuaTeX error ...TeXt/tex/texmf-context/tex/context/base/regi-ini.lua:100: attempt to call global 'translate' (a nil value).", although I added two "print(...)" before "return regimes...".
>
>
> On Sun, 28 Nov 2010 19:08:56 +0100, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
>
>>
>> regi-ini.lua
>>
>>   function regimes.process(s)
>> -     return translate(s,regimes.currentregime)
>> +     return regimes.translate(s,regimes.currentregime)
>>   end

___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2010-11-29 14:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-28 17:52 Problem \input a file (lastest minimals) Procházka Lukáš
2010-11-28 18:08 ` Wolfgang Schuster
2010-11-28 18:20   ` Hans Hagen
2010-11-28 22:44   ` Procházka Lukáš
2010-11-29 14:13     ` Procházka Lukáš Ing. - Pontex s. r. o.

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).