ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* 'lua.registercode' bug in latest beta
@ 2017-11-07  3:59 Li Yanrui (李延瑞)
  2017-11-07  7:14 ` Henning Hraban Ramm
  2017-11-26 14:05 ` Marco Patzer
  0 siblings, 2 replies; 5+ messages in thread
From: Li Yanrui (李延瑞) @ 2017-11-07  3:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi,

Using '\ctxloadluafile'  can get an error:

```
..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument
#1 to 'gmatch' (string expected, got nil)
```

It seems to be caused by 'if options ~= ""' in `lua.registercode'. That
empyt string should be 'nil'?

-- 
Best regards,

Li Yanrui (李延瑞)

[-- Attachment #1.2: Type: text/html, Size: 576 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: 'lua.registercode' bug in latest beta
  2017-11-07  3:59 'lua.registercode' bug in latest beta Li Yanrui (李延瑞)
@ 2017-11-07  7:14 ` Henning Hraban Ramm
  2017-11-18 17:37   ` Henning Hraban Ramm
  2017-11-26 14:05 ` Marco Patzer
  1 sibling, 1 reply; 5+ messages in thread
From: Henning Hraban Ramm @ 2017-11-07  7:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2017-11-07 um 04:59 schrieb Li Yanrui (李延瑞) <liyanrui.m2@gmail.com>:

> Hi,
> 
> Using '\ctxloadluafile'  can get an error:
> 
> ```
> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 to 'gmatch' (string expected, got nil)
> ```

Same here:

lua error       > lua error on line 30 in file /Users/hraban/Library/texmf/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument #1 to 'gmatch' (string expected, got nil)
stack traceback:
	[C]: in function 'gmatch'
	...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in function 'registercode'
	[ctxlua]:1: in main chunk

20     %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21     %C GNU General Public License for more details.
22     %C
23     %C You should have received a copy of the GNU General Public License
24     %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25     
26     \unprotect
27     
28     % Lua functions for the core and also for the frontend modules
29     
30 >>  \ctxloadluafile{s-cor-00}



> It seems to be caused by 'if options ~= ""' in `lua.registercode'. That empyt string should be 'nil'?

Yep, after 'context --make' that lets it work for me.
Thank you!

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

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

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

* Re: 'lua.registercode' bug in latest beta
  2017-11-07  7:14 ` Henning Hraban Ramm
@ 2017-11-18 17:37   ` Henning Hraban Ramm
  0 siblings, 0 replies; 5+ messages in thread
From: Henning Hraban Ramm @ 2017-11-18 17:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2017-11-07 um 08:14 schrieb Henning Hraban Ramm <texml@fiee.net>:

> Am 2017-11-07 um 04:59 schrieb Li Yanrui (李延瑞) <liyanrui.m2@gmail.com>:
> 
>> Hi,
>> 
>> Using '\ctxloadluafile'  can get an error:
>> 
>> ```
>> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 to 'gmatch' (string expected, got nil)
>> ```
> 
> Same here:
> 
> lua error       > lua error on line 30 in file /Users/hraban/Library/texmf/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:
> 
> ...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument #1 to 'gmatch' (string expected, got nil)
> stack traceback:
> 	[C]: in function 'gmatch'
> 	...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in function 'registercode'
> 	[ctxlua]:1: in main chunk
> 
> 20     %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> 21     %C GNU General Public License for more details.
> 22     %C
> 23     %C You should have received a copy of the GNU General Public License
> 24     %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
> 25     
> 26     \unprotect
> 27     
> 28     % Lua functions for the core and also for the frontend modules
> 29     
> 30 >>  \ctxloadluafile{s-cor-00}
> 
> 
> 
>> It seems to be caused by 'if options ~= ""' in `lua.registercode'. That empyt string should be 'nil'?
> 
> Yep, after 'context --make' that lets it work for me.
> Thank you!


Why is this still not fixed? It’s so easy, but I don’t like to patch it after every update again!

Please change "" to nil in tex/texmf-context/tex/context/base/mkiv/luat-cod.lua, line 49!

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

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

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

* Re: 'lua.registercode' bug in latest beta
  2017-11-07  3:59 'lua.registercode' bug in latest beta Li Yanrui (李延瑞)
  2017-11-07  7:14 ` Henning Hraban Ramm
@ 2017-11-26 14:05 ` Marco Patzer
  2017-11-26 14:20   ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Marco Patzer @ 2017-11-26 14:05 UTC (permalink / raw)
  To: ntg-context

On Tue, 7 Nov 2017 11:59:51 +0800
Li Yanrui (李延瑞) <liyanrui.m2@gmail.com> wrote:

> Using '\ctxloadluafile'  can get an error:
> 
> ```
> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad
> argument #1 to 'gmatch' (string expected, got nil)
> ```
> 
> It seems to be caused by 'if options ~= ""' in `lua.registercode'.
> That empyt string should be 'nil'?

I can confirm the issue, MWE:

\usemodule [letter]
\starttext
\null
\stoptext

throws:

open source     > level 4, order 5, name '/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'

lua error       > lua error on line 30 in file /tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 to 'gmatch' (string expected, got nil)
stack traceback:
	[C]: in function 'gmatch'
	...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: in function 'registercode'
	[ctxlua]:1: in main chunk

20     %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21     %C GNU General Public License for more details.
22     %C
23     %C You should have received a copy of the GNU General Public License
24     %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25     
26     \unprotect
27     
28     % Lua functions for the core and also for the frontend modules
29     
30 >>  \ctxloadluafile{s-cor-00}

context: 2017.11.22 13:35

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

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

* Re: 'lua.registercode' bug in latest beta
  2017-11-26 14:05 ` Marco Patzer
@ 2017-11-26 14:20   ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2017-11-26 14:20 UTC (permalink / raw)
  To: ntg-context

On 11/26/2017 3:05 PM, Marco Patzer wrote:
> On Tue, 7 Nov 2017 11:59:51 +0800
> Li Yanrui (李延瑞) <liyanrui.m2@gmail.com> wrote:
> 
>> Using '\ctxloadluafile'  can get an error:
>>
>> ```
>> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad
>> argument #1 to 'gmatch' (string expected, got nil)
>> ```
>>
>> It seems to be caused by 'if options ~= ""' in `lua.registercode'.
>> That empyt string should be 'nil'?

that line should be:

         if type(options) == "string" and options ~= "" then

> I can confirm the issue, MWE:
> 
> \usemodule [letter]
> \starttext
> \null
> \stoptext
> 
> throws:
> 
> open source     > level 4, order 5, name '/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'
> 
> lua error       > lua error on line 30 in file /tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:
> 
> ...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 to 'gmatch' (string expected, got nil)
> stack traceback:
> 	[C]: in function 'gmatch'
> 	...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: in function 'registercode'
> 	[ctxlua]:1: in main chunk
 >
> 20     %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> 21     %C GNU General Public License for more details.
> 22     %C
> 23     %C You should have received a copy of the GNU General Public License
> 24     %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
> 25
> 26     \unprotect
> 27
> 28     % Lua functions for the core and also for the frontend modules
> 29
> 30 >>  \ctxloadluafile{s-cor-00}
> 
> context: 2017.11.22 13:35
> 
> Marco
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
> 


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2017-11-26 14:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07  3:59 'lua.registercode' bug in latest beta Li Yanrui (李延瑞)
2017-11-07  7:14 ` Henning Hraban Ramm
2017-11-18 17:37   ` Henning Hraban Ramm
2017-11-26 14:05 ` Marco Patzer
2017-11-26 14:20   ` Hans Hagen

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