ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Missing parinitskips in \normalizelinemode=0
@ 2022-10-19  1:01 Max Chernoff via ntg-context
  2022-10-19  9:59 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Max Chernoff via ntg-context @ 2022-10-19  1:01 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff

Hi Hans,

When running in \normalizelinemode=0, the \parinitleftskip and 
\parinitrightskip nodes are either nonexistant or invisible from Lua,
causing tex.linebreak to not work correctly.

This sample file:

   \enabledirectives[system.callbacks.permitoverloads]
   
   \normalizelinemode=0
   
   \directlua{
       callback.register("pre_linebreak_filter", function(head)
           tex.preparelinebreak(head)
           local list, info = tex.linebreak(head)
           print(info)
   
           return head
       end)
   }
   
   \starttext
      \input knuth
   \stoptext

Produces this output:

   luatex warning  > linebreak: list seems already prepared
   luatex warning  > linebreak: [ leftinit | rightinit | leftfill | rigthfill ] expected
   nil
   
Thanks,
-- Max
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Missing parinitskips in \normalizelinemode=0
  2022-10-19  1:01 Missing parinitskips in \normalizelinemode=0 Max Chernoff via ntg-context
@ 2022-10-19  9:59 ` Hans Hagen via ntg-context
  2022-10-27  3:48   ` Max Chernoff via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2022-10-19  9:59 UTC (permalink / raw)
  To: Max Chernoff via ntg-context; +Cc: Hans Hagen

On 10/19/2022 3:01 AM, Max Chernoff via ntg-context wrote:
> Hi Hans,
> 
> When running in \normalizelinemode=0, the \parinitleftskip and
> \parinitrightskip nodes are either nonexistant or invisible from Lua,
> causing tex.linebreak to not work correctly.
> 
> This sample file:
> 
>     \enabledirectives[system.callbacks.permitoverloads]
>     
>     \normalizelinemode=0
>     
>     \directlua{
>         callback.register("pre_linebreak_filter", function(head)
>             tex.preparelinebreak(head)
>             local list, info = tex.linebreak(head)
>             print(info)
>     
>             return head
>         end)
>     }
>     
>     \starttext
>        \input knuth
>     \stoptext
> 
> Produces this output:
> 
>     luatex warning  > linebreak: list seems already prepared
>     luatex warning  > linebreak: [ leftinit | rightinit | leftfill | rigthfill ] expected
>     nil
i'll bypass that warnign when the mode is zero

btw, you need to work with a copy of the list

Hans

-----------------------------------------------------------------
                                           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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Missing parinitskips in \normalizelinemode=0
  2022-10-19  9:59 ` Hans Hagen via ntg-context
@ 2022-10-27  3:48   ` Max Chernoff via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Max Chernoff via ntg-context @ 2022-10-27  3:48 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff


Hi Hans,

> i'll bypass that warnign when the mode is zero

I saw that you made that change in the latest upload, thanks.
Unfortunately, I'm still getting the same output:

   luatex warning  > linebreak: list seems already prepared
   luatex warning  > linebreak: [ leftinit | rightinit | leftfill | rigthfill ] expected
   nil
   
Also, what's causing me issues isn't the warning but rather that
tex.linebreak is returning nil instead of an info table as the second
return value.

> btw, you need to work with a copy of the list

Now that you point that out, I'm actually surprised that that example
worked at all. The real code does use a copy of the list though (and
also uses the proper callback interfaces instead of "system.callbacks.
permitoverloads")

Thanks,
-- Max

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2022-10-27  3:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19  1:01 Missing parinitskips in \normalizelinemode=0 Max Chernoff via ntg-context
2022-10-19  9:59 ` Hans Hagen via ntg-context
2022-10-27  3:48   ` Max Chernoff via ntg-context

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