From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/105853 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf Bahr Newsgroups: gmane.comp.tex.context Subject: Re: "error not related to input file" Date: Mon, 16 Dec 2019 21:03:29 +0100 Message-ID: <20191216200329.GA3893@nan> References: <20191214164345.GA5156@nan> <57670e8a-9ffa-a6b4-f425-220b3bd171e4@xs4all.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263133"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.9.4 (2018-02-28) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 16 21:04:52 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1igwbs-0016LR-4K for gctc-ntg-context-518@m.gmane.org; Mon, 16 Dec 2019 21:04:52 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 04AA31643AB; Mon, 16 Dec 2019 21:03:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uGOCgb0gap1e; Mon, 16 Dec 2019 21:03:39 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 36ADC163F26; Mon, 16 Dec 2019 21:03:39 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DDF65163F26 for ; Mon, 16 Dec 2019 21:03:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fJ22o012BHVy for ; Mon, 16 Dec 2019 21:03:32 +0100 (CET) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=185.26.156.68; helo=brooks.uberspace.de; envelope-from=quasi@quasi.de; receiver= Original-Received: from brooks.uberspace.de (brooks.uberspace.de [185.26.156.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id C1698163E9D for ; Mon, 16 Dec 2019 21:03:32 +0100 (CET) Original-Received: (qmail 22893 invoked from network); 16 Dec 2019 20:03:31 -0000 Original-Received: from unknown (HELO localhost) (5.83.181.220) by brooks.uberspace.de with SMTP; 16 Dec 2019 20:03:31 -0000 Content-Disposition: inline In-Reply-To: <57670e8a-9ffa-a6b4-f425-220b3bd171e4@xs4all.nl> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:105853 Archived-At: --T4sUOijqQbZv57TR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Sat, Dec 14, 2019 at 10:31:20PM +0100, Hans Hagen wrote: > On 12/14/2019 5:43 PM, Rudolf Bahr wrote: > > > > Hello All, > > > > In: > > LuaMetaTeX, Version 2.03.3 > > ConTeXt ver: 2019.12.12 19:35 MKIV beta fmt: 2019.12.12 int: english/english > > I get the following error message: > > > > tex error > error not related to input file: > > tex error > tex: ! Emergency stop > > tex error > lua: ? > > tex error > mps: - > > > > In LuaTeX ... I get a "*" instead of the error message above. > > And again my program does all what it should, but a grey pdf-page too. > > > > Sorry, no MWE available. On Sat, Dec 14, 2019 at 07:27:34PM +0100, Otared Kavian wrote: > > Since I have also suffered somewhat from the cryptic (and often useless…) error messages, I understand your frustration :-) > Now, maybe if you do > context --directives="system.showerror" myfile.tex > then you get a file named « myfile-status.html » which is more helpful. On Sat, Dec 14, 2019 at 10:31:20PM +0100, Hans Hagen wrote: > > normally an * means: waiting for input .... and no message is then involved > as in principle there is no real error, apart from waiting for input Otared and Hans, thank you for your answers and Otared especially for your sympathy! :-) In the meantime I could get rid of "! Emergency stop" and "*" by changing a \def-command which calls a luacode subprogram; see further down in my MWE. My program run now looks essentially better, but "--directives="system.showerror" and "-status.html" still report an error: "! Undefined control sequence" without telling which control sequence is undefined. How reliable is this error message? I don't know of control sequences in luacode or what does this error message mean? Here is a MWE which shows my program structure. Sorry, this MWE works really :-) During my attempts to find the error I got for a short time the message: "Invalid \starttext ... \stoptext structure" which I don't understand. --------------------------------------------------- MWE ------------------------------- \def\projectpath{/home/sam/trip-2019/} \startluacode userdata = userdata or {} u = userdata function u.table_save ( tab, file ) local tab = tab local file = file dofile ("table_save_u_table_load.lua") table.save(tab, file) end function u.Init ( col ) local col = col local ppth = tokens.getters.macro("projectpath") local xO = tokens.getters.macro("xO") local yO = tokens.getters.macro("yO") local I = {} -- Table of initial values I ["projectpath"] = ppth I ["column"] = {} I ["column"][col] = {} I ["column"][col]["layerpos"] = {} I ["column"][col]["layerpos"] ["xO"] = xO I ["column"][col]["layerpos"] ["yO"] = yO u.table_save(I,"I-Table.lua") end \stopluacode %\def\Init #1 {\ctxlua {u.Init ([==[#1]==]) }}% --the blanks produced my "! Emergency stop" \def\Init#1{\ctxlua{u.Init([==[#1]==])}}% --in this form the command works \starttext \def\Column{A}% \def\xO{0}% in pt \def\yO{20}% in pt \Init{\Column}%% \stoptext --------------------------------------------------------------------------------------- For those possibly interested in running this MWE I append "table_save_u_table_load.lua", a lua program to save and reload lua tables, found in the lua homepage. Anyway, the resulting flattened table "I" is here: return { -- Table: {1} { ["column"]={2}, ["projectpath"]="/home/sam/trip-2019/", }, -- Table: {2} { ["A"]={3}, }, -- Table: {3} { ["layerpos"]={4}, }, -- Table: {4} { ["yO"]="20", ["xO"]="0", }, } I think nobody will be able to help me in this case, I myself have to try again and again to finally find the error. If so, this would be the nicest christmas gift to me :-) Best regards, Rudolf --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="table_save_u_table_load.lua" --[[ Save Table to File Load Table from File v 1.0 Lua 5.2 compatible Only Saves Tables, Numbers and Strings Insides Table References are saved Does not save Userdata, Metatables, Functions and indices of these ---------------------------------------------------- table.save( table , filename ) on failure: returns an error msg ---------------------------------------------------- table.load( filename or stringtable ) Loads a table that has been saved via the table.save function on success: returns a previously saved table on failure: returns as second argument an error msg ---------------------------------------------------- Licensed under the same terms as Lua itself. ]]-- do -- declare local variables --// exportstring( string ) --// returns a "Lua" portable version of the string local function exportstring( s ) return string.format("%q", s) end --// The Save Function function table.save( tbl,filename ) local charS,charE = " ","\n" local file,err = io.open( filename, "wb" ) if err then return err end -- initiate variables for save procedure local tables,lookup = { tbl },{ [tbl] = 1 } file:write( "return {"..charE ) for idx,t in ipairs( tables ) do file:write( "-- Table: {"..idx.."}"..charE ) file:write( "{"..charE ) local thandled = {} for i,v in ipairs( t ) do thandled[i] = true local stype = type( v ) -- only handle value if stype == "table" then if not lookup[v] then table.insert( tables, v ) lookup[v] = #tables end file:write( charS.."{"..lookup[v].."},"..charE ) elseif stype == "string" then file:write( charS..exportstring( v )..","..charE ) elseif stype == "number" then file:write( charS..tostring( v )..","..charE ) end end for i,v in pairs( t ) do -- escape handled values if (not thandled[i]) then local str = "" local stype = type( i ) -- handle index if stype == "table" then if not lookup[i] then table.insert( tables,i ) lookup[i] = #tables end str = charS.."[{"..lookup[i].."}]=" elseif stype == "string" then str = charS.."["..exportstring( i ).."]=" elseif stype == "number" then str = charS.."["..tostring( i ).."]=" end if str ~= "" then stype = type( v ) -- handle value if stype == "table" then if not lookup[v] then table.insert( tables,v ) lookup[v] = #tables end file:write( str.."{"..lookup[v].."},"..charE ) elseif stype == "string" then file:write( str..exportstring( v )..","..charE ) elseif stype == "number" then file:write( str..tostring( v )..","..charE ) end end end end file:write( "},"..charE ) end file:write( "}" ) file:close() end --// The Load Function function table.load( sfile ) local ftables,err = loadfile( sfile ) if err then return _,err end local tables = ftables() for idx = 1,#tables do local tolinki = {} for i,v in pairs( tables[idx] ) do if type( v ) == "table" then tables[idx][i] = tables[v[1]] end if type( i ) == "table" and tables[i[1]] then table.insert( tolinki,{ i,tables[i[1]] } ) end end -- link indices for _,v in ipairs( tolinki ) do tables[idx][v[2]],tables[idx][v[1]] = tables[idx][v[1]],nil end end return tables[1] end -- close do end do local function file_exists(name) local f=io.open(name,"r") if f~=nil then io.close(f) return true else return false end end end --return { -- table.save = table.save, -- table.load = table.load, -- file_exists = file_exists, --} --T4sUOijqQbZv57TR Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --T4sUOijqQbZv57TR--