ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Max Chernoff via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Max Chernoff <mseven@telus.net>, ebohoyod@disroot.org
Subject: Re: lua-widow-control module error in LMTX
Date: Mon, 25 Apr 2022 14:00:49 -0600	[thread overview]
Message-ID: <3456f6af-1770-d46e-899d-bcefddda5689@telus.net> (raw)
In-Reply-To: <5ce51ba2-4f68-6f5f-3ce5-a1baf7a7efe5@disroot.org>

(Please keep me CC'd as I'm not subscribed to the list)

Hi, I'm the lua-widow-control author.

 > lua error > lua error on line 74 in file
 > 
/opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl
 >
 > The odd thing is that line 75 of the t-lua-widow-control file is empty.

The \setuplwc command ends on line 74, which then triggers 
\everysetuplwc which then calls \ctxlua{lwc.enable_callbacks()}. This 
fails since lwc is undefined because the Lua file isn't loaded because 
ConTeXt can't seem to find the file.

In Plain LuaTeX and LuaLaTeX, a missing Lua file is a fatal error:

     $ luatex "\nonstopmode\directlua{require 'not-a-real-file'}\bye"

     This is LuaTeX, Version 1.13.2 (TeX Live 2021/W32TeX)
      restricted system commands enabled.

     [\directlua]:1: module 'not-a-real-file' not found:
             no field package.preload['not-a-real-file']
             [kpse lua searcher] file not found: 'not-a-real-file'
     stack traceback:
             [C]: in function 'require'
             [\directlua]:1: in main chunk.
     <*> \nonstopmode\directlua{require 'not-a-real-file'}
                                                       \bye
     (see the transcript file for additional information)
     warning  (pdf backend): no pages of output.
     Transcript written on texput.log.

so I'm a little surprised that ConTeXt just issues a warning here when 
it can't find the file:

    resolvers > lua > unknown file 'lua-widow-control.lua'

 > when it says it doesn't know the lua-widow-control.lua file. I don't see
 > any mention of this file within the t-lua-widow-control module.

lua-widow-control.lua is loaded at line 63 of the .mkxl:
     \ctxloadluafile{lua-widow-control}

 > Could it be that this module is not yet mature for lmtx

Lua-widow-control is certainly more stable with Plain/LaTeX, but it 
usually runs fine with LMTX. The entire lwc manual is written in 
ConTeXt/LMTX so I (usually) notice pretty quickly when things break.

The only real "issue" with LMTX is that the engine changes pretty 
quickly, so lwc may sometimes be broken for a few days between an engine 
update and whenever I push out a fix. This doesn't happen with 
Plain/LaTeX since the LuaTeX engine is mostly frozen.

Interestingly, the MkXL version of lwc actually predates the MkIV 
version, although only by a few months.

 > I have \usemodule[lua-widow-control] in my tex document, and
 > I haven't forgotten to do the prescribed mtxrun --generate after
 > including the module in my third-party folder of my luametatex
 > installation on Arch.

Hmm, that's odd then. I'm not entirely sure why this is happening, so 
I'm going to take a random guess:

Maybe you installed lwc using a zipfile from either GitHub or the 
ConTeXt Garden modules site, then you copied the files into your 
texmf-modules/ folder, *but* you only copied the "tex/context/" folder 
and not all of the folders in the "tex" folder. The 
"lua-widow-control.lua" file is in the "tex/luatex/" folder, so if you 
didn't also copy that across you're going to have problems.

Again, just a random guess.  If that doesn't work, you could maybe try 
running
     context --make
but I doubt that that would fix anything here. You could also try 
deleting the filename cache files at:
     {CONTEXT}/texmf-cache/luametatex-cache/context/*/trees/*.lu?
then rerunning
     mtxrun --generate
I've never deleted those files before, but it's in a folder called 
"cache" so it's _probably_ safe to delete (make a backup just in case 
though).

If none of that works, then the issue could be something else on your 
end, or I could have screwed something up in lwc. In that case, try running
     find /opt/luametatex/texmf-modules/ -path '*widow*' -print
and
     mtxrun --find-file lua-widow-control.lua
and reply with the output.

Oh, and one more note. ConTeXt version "2022-04-11 19:20" renamed some 
of the engine Lua functions, so make sure to update to lwc v2.0.6 (if 
you're using a recent ConTeXt version). Otherwise after you fix the 
"unknown file" error, you would get an "attempt to call a nil value" 
error which isn't any better.

Let me know if you have any other issues.

  -- Max
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2022-04-25 20:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 20:08 Eduardo Bohoyo via ntg-context
2022-04-21 20:09 ` Eduardo Bohoyo via ntg-context
2022-05-14  7:58   ` Max Chernoff via ntg-context
2022-04-25 20:00 ` Max Chernoff via ntg-context [this message]
2022-04-26  0:51   ` Eduardo Bohoyo via ntg-context
2022-04-26  2:42     ` Max Chernoff via ntg-context
2022-04-26  9:45       ` Eduardo Bohoyo via ntg-context
2022-04-26  9:49         ` Eduardo Bohoyo via ntg-context
2022-04-27  7:14         ` Max Chernoff via ntg-context
     [not found]           ` <fff1ae26-4094-1f46-48aa-e0d44ae92daa@disroot.org>
2022-04-27 22:02             ` Fwd: " Eduardo Bohoyo via ntg-context
2022-04-28  7:25             ` Max Chernoff via ntg-context
2022-04-28  9:30               ` Henning Hraban Ramm via ntg-context
2022-04-29  0:38                 ` Max Chernoff via ntg-context
2022-04-29 12:20                   ` Eduardo Bohoyo via ntg-context
2022-04-28 10:54               ` Eduardo Bohoyo via ntg-context
2022-04-28 11:43                 ` Henning Hraban Ramm via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3456f6af-1770-d46e-899d-bcefddda5689@telus.net \
    --to=ntg-context@ntg.nl \
    --cc=ebohoyod@disroot.org \
    --cc=mseven@telus.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).