[NTG-context] Stack overflow

2010-03-20 Thread Alain Delmotte

Hi!

I just upgraded ConTeXt minimals
(from the status-of-update.lua file:
[info]={
 [comment]=this file contains the settings of the last 'mtxrun 
--script update ' run,

 [count]=3,
 [date]=2010-03-20 09:14:09,
 [runtime]=90.688,
 [version]=0.1,
},
)

When I want to compile the file on which I am working, I get:
C:\Programmes\ConTeXt\tex\texmf-mswin\bin\mtxrun.lua:2161: stack overflow

So, I am stuck.


What is the solution?


Alain


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


Re: [NTG-context] Stack overflow

2010-03-20 Thread Andreas Schneider
Alain Delmotte wrote:

 When I want to compile the file on which I am working, I get:
 C:\Programmes\ConTeXt\tex\texmf-mswin\bin\mtxrun.lua:2161: stack overflow

The same happens to me, but only when I invoke context.exe. It works fine 
with context.cmd. (The same holds true for mtxrun.exe vs. mtxrun.cmd and 
probably others.)

(Using recent minimals from the garden.)

Best Regards,
Andreas.


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


[NTG-context] new contextbeta distribution broken?

2010-03-20 Thread Hans van der Meer

Downloaded contextbeta as usual:
ConTeXt  ver: 2010.03.18 14:42 MKIV  fmt: 2010.3.20  int: english/ 
english


Suddenly got this error from: \setupinterlinespace[big]

! Missing number, treated as zero.
to be read againb
argument b
ig
\doifdimensionelse ...mensionelse \scratchdimen #1
  pt\relax
\dosetspecifiedrelativeinterlinespace ...else {#1}

{\setupspecifiedinterline...

\dosetuprelativeinterlinespace ...erlinespace {#1}
  \fi
\next1 #1,-\dosetuprelativeinterlinespace {#1}
   \doprocesscommaitem

Then did luatools --generate that now broke:

02 ~/Documents/TeX/context/beta/bin: luatools --generate
LuaTools | fileio: variable 'SELFAUTOLOC' set to '/Users/hans/ 
Documents/TeX/context/beta/bin'
LuaTools | fileio: variable 'SELFAUTODIR' set to '/Users/hans/ 
Documents/TeX/context/beta'
LuaTools | fileio: variable 'SELFAUTOPARENT' set to '/Users/hans/ 
Documents/TeX/context'
LuaTools | fileio: variable 'TEXMFCNF' set to '{$SELFAUTODIR, 
$SELFAUTOPARENT}{,{/share,}/texmf{-local,.local,}/web2c}'

LuaTools | fileio: no cnf files found (TEXMFCNF may not be set/known)
LuaTools |
LuaTools | runtime: 0.053 seconds
103 ~/Documents/TeX/context/beta/bin:

Switching back to my previous version of contextbeta gave no problems.  
Processing lustools --generate without problems. Especially the  
previous culprit now does:
LuaTools | fileio: variable 'TEXMFCNF' set to '{$SELFAUTODIR, 
$SELFAUTOPARENT}{,{/share,}/texmf{-local,.local,}/web2c}'
LuaTools | fileio: loading configuration file '/Users/hans/Documents/ 
TeX/context/beta/tex/texmf/web2c/texmfcnf.lua'


WHAT HAPPENED?

Hans van der Meer




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


Re: [NTG-context] Stack overflow

2010-03-20 Thread Alain Delmotte

Hi!

Andreas Schneider a écrit :

Alain Delmotte wrote:

  

When I want to compile the file on which I am working, I get:
C:\Programmes\ConTeXt\tex\texmf-mswin\bin\mtxrun.lua:2161: stack overflow



The same happens to me, but only when I invoke context.exe. It works fine 
with context.cmd. (The same holds true for mtxrun.exe vs. mtxrun.cmd and 
probably others.)


(Using recent minimals from the garden.)
  
Same here; as I am using TeXworks, I redefined mtxrun to mtxrun.cmd and 
it worked!


I did upgrade to see if the other problem was solved
See the message from Aditya about Re: [NTG-context] Unable to use 
example from Excursion 19/03/2010 16:03

message id: alpine.lnx.2.01.1003191101070.14...@ybpnyubfg.ybpnyqbznva
(On Fri, 12 Mar 2010, Hans Hagen wrote:


fixed in next beta


The bug is still present in  2010.03.18. Here is a minimal example:

\definetype[typeTEX][option=tex, style=type]
\starttext

\placefigure
 [top,bottom]
 [fig:something]
 {Do \type{\undefined} and \typeTEX{\undefined} work?}
 {}

\stoptext

which gives .../...

Best regards,

Alain

Best Regards,
Andreas.


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

  


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


Re: [NTG-context] new contextbeta distribution broken?

2010-03-20 Thread Wolfgang Schuster

Am 20.03.10 13:13, schrieb Hans van der Meer:


WHAT HAPPENED?


Please don't shout as us, it's also polite to provide a minimal example.

Now to your problem.

Hans added recently a interlinespace key to \setuphead and modified
\setupinterlinespace for this, the problem with this is that he need
to check wheter the argument is a dimension (e.g. 12pt) or a keyword
(e.g. big) but the \doifdimensionelse macro fails in this case.

Till Hans fix this here is a adapted dimen checker from KOMA Script.

\unprotect

\definesystemconstant  {pc}
\definesystemconstant  {cm}
\definesystemconstant  {dd}
\definesystemconstant  {cc}

\def\ifdimen#1%
  {\begingroup\donetrue\let\next\t...@posdimen
   \expandafter\t...@dimen#1\next
   \ifdone
 \endgroup\expandafter\firstoftwoarguments
   \else
 \endgroup\expandafter\secondoftwoarguments
   \fi}

\def\t...@dimen#1%
  {\ifx-#1\else\ifx +#1\else
 \def\next{\let\next\t...@posdimen\next#1}%
   \fi\fi
   \next}

\def\t...@posdimen#1%
  {\ifx\next#1%
 \donefalse\let\next\relax
   \else
 \if.#1\else\if,#1\else
\scratchcounter=%
\expandafter\expandafter\expandafter\number\expandafter`#1\relax
\ifnum\scratchcounter47
  \ifnum\scratchcounter58
  \else\def\next{\t...@dimunt#1}\fi
\else\def\next{\t...@dimunt#1}\fi
\fi\fi
   \fi
   \next}

\def\t...@dimunt#1\next
  {\expandafter\t...@trueunt#1truetrue\test@trueunt}

\def\t...@trueunt#1true#2true#3\test@trueunt
  {\edef\!!stringa{#1}%
   \ifx\!!stringa\empty
 \test@@ifdimunt{#2}%
   \else
 \test@@ifdimunt{#1}%
   \fi}

%\def\test@@ifdimunt#1%
%  {\donefalse
%   \doifelse{#1}\s!pt\donetrue
% {\doifelse{#1}\s!pc\donetrue
%{\doifelse{#1}\s!in\donetrue
%   {\doifelse{#1}\s!bp\donetrue
%  {\doifelse{#1}\s!cm\donetrue
% {\doifelse{#1}\s!mm\donetrue
%{\doifelse{#1}\s!dd\donetrue
%   {\doifelse{#1}\s!cc\donetrue
%  {\doifelse{#1}\s!sp\donetrue
% {\doifelse{#1}\c!ex\donetrue
%{\doif{#1}\c!em\donetrue}}}

\def\test@@ifdimunt#1%
  {\edef\!!stringa{#1}%
   \donefalse
   \ifx\!!stringa\s!pt\donetrue\else
 \ifx\!!stringa\s!pc\donetrue\else
   \ifx\!!stringa\s!in\donetrue\else
 \ifx\!!stringa\s!bp\donetrue\else
   \ifx\!!stringa\s!cm\donetrue\else
 \ifx\!!stringa\s!mm\donetrue\else
   \ifx\!!stringa\s!dd\donetrue\else
 \ifx\!!stringa\s!cc\donetrue\else
   \ifx\!!stringa\s!sp\donetrue\else
 \ifx\!!stringa\c!ex\donetrue\else
   \ifx\!!stringa\c!em\donetrue
   \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}

\protect

\starttext

12pt: \ifdimen{12pt}{yes}{no}

big: \ifdimen{big}{yes}{no}

34cm: \ifdimen{34cm}{yes}{no}

\dorecurse{10}{\ifdimen{34cm}{}{}} % \doifelse: 8.6s, \ifx: 7.7s

\stoptext

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
___


Re: [NTG-context] new contextbeta distribution broken?

2010-03-20 Thread Hans Hagen

On 20-3-2010 17:57, Wolfgang Schuster wrote:

Am 20.03.10 13:13, schrieb Hans van der Meer:


WHAT HAPPENED?


Please don't shout as us, it's also polite to provide a minimal example.

Now to your problem.

Hans added recently a interlinespace key to \setuphead and modified
\setupinterlinespace for this, the problem with this is that he need
to check wheter the argument is a dimension (e.g. 12pt) or a keyword
(e.g. big) but the \doifdimensionelse macro fails in this case.

Till Hans fix this here is a adapted dimen checker from KOMA Script.

\unprotect

\definesystemconstant {pc}
\definesystemconstant {cm}
\definesystemconstant {dd}
\definesystemconstant {cc}

\def\ifdimen#1%
{\begingroup\donetrue\let\next\t...@posdimen
\expandafter\t...@dimen#1\next
\ifdone
\endgroup\expandafter\firstoftwoarguments
\else
\endgroup\expandafter\secondoftwoarguments
\fi}

\def\t...@dimen#1%
{\ifx-#1\else\ifx +#1\else
\def\next{\let\next\t...@posdimen\next#1}%
\fi\fi
\next}

\def\t...@posdimen#1%
{\ifx\next#1%
\donefalse\let\next\relax
\else
\if.#1\else\if,#1\else
\scratchcounter=%
\expandafter\expandafter\expandafter\number\expandafter`#1\relax
\ifnum\scratchcounter47
\ifnum\scratchcounter58
\else\def\next{\t...@dimunt#1}\fi
\else\def\next{\t...@dimunt#1}\fi
\fi\fi
\fi
\next}

\def\t...@dimunt#1\next
{\expandafter\t...@trueunt#1truetrue\test@trueunt}

\def\t...@trueunt#1true#2true#3\test@trueunt
{\edef\!!stringa{#1}%
\ifx\!!stringa\empty
\test@@ifdimunt{#2}%
\else
\test@@ifdimunt{#1}%
\fi}

%\def\test@@ifdimunt#1%
% {\donefalse
% \doifelse{#1}\s!pt\donetrue
% {\doifelse{#1}\s!pc\donetrue
% {\doifelse{#1}\s!in\donetrue
% {\doifelse{#1}\s!bp\donetrue
% {\doifelse{#1}\s!cm\donetrue
% {\doifelse{#1}\s!mm\donetrue
% {\doifelse{#1}\s!dd\donetrue
% {\doifelse{#1}\s!cc\donetrue
% {\doifelse{#1}\s!sp\donetrue
% {\doifelse{#1}\c!ex\donetrue
% {\doif{#1}\c!em\donetrue}}}

\def\test@@ifdimunt#1%
{\edef\!!stringa{#1}%
\donefalse
\ifx\!!stringa\s!pt\donetrue\else
\ifx\!!stringa\s!pc\donetrue\else
\ifx\!!stringa\s!in\donetrue\else
\ifx\!!stringa\s!bp\donetrue\else
\ifx\!!stringa\s!cm\donetrue\else
\ifx\!!stringa\s!mm\donetrue\else
\ifx\!!stringa\s!dd\donetrue\else
\ifx\!!stringa\s!cc\donetrue\else
\ifx\!!stringa\s!sp\donetrue\else
\ifx\!!stringa\c!ex\donetrue\else
\ifx\!!stringa\c!em\donetrue
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}

\protect

\starttext

12pt: \ifdimen{12pt}{yes}{no}

big: \ifdimen{big}{yes}{no}

34cm: \ifdimen{34cm}{yes}{no}

\dorecurse{10}{\ifdimen{34cm}{}{}} % \doifelse: 8.6s, \ifx: 7.7s

\stoptext


\chardef\d!pt\plusone
\chardef\d!pc\plusone
\chardef\d!in\plusone
\chardef\d!bp\plusone
\chardef\d!cm\plusone
\chardef\d!mm\plusone
\chardef\d!dd\plusone
\chardef\d!cc\plusone
\chardef\d!sp\plusone
\chardef\d!ex\plusone
\chardef\d!em\plusone

\def\test@@ifdimunt#1%
  {\ifcsname d!#1\endcsname
 \donetrue
   \else
 \donefalse
   \fi}

\testfeatureonce{10}{\ifdimen{34cm}{}{}}

10% faster ... anyhow, quite ugly code ... i'll have a look at why the 
normal one fails


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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
___


Re: [NTG-context] new contextbeta distribution broken?

2010-03-20 Thread Hans van der Meer

On 20 mrt 2010, at 17:57, Wolfgang Schuster wrote:


Am 20.03.10 13:13, schrieb Hans van der Meer:


WHAT HAPPENED?


Please don't shout as us, it's also polite to provide a minimal  
example.


Do not read me wrong. It is not shouting at anyone. Just embolding  
and utter despair.
If you feel in anyway attacked, sorry, it wasn't my intention (and  
will never be).
As for the minimal example, that was implicite in the problem: the  
minimal example in this case is the distribution itself.


Hans van der Meer


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


Re: [NTG-context] new contextbeta distribution broken?

2010-03-20 Thread Wolfgang Schuster

Am 20.03.10 18:49, schrieb Hans Hagen:

\chardef\d!pt\plusone
\chardef\d!pc\plusone
\chardef\d!in\plusone
\chardef\d!bp\plusone
\chardef\d!cm\plusone
\chardef\d!mm\plusone
\chardef\d!dd\plusone
\chardef\d!cc\plusone
\chardef\d!sp\plusone
\chardef\d!ex\plusone
\chardef\d!em\plusone

\def\test@@ifdimunt#1%
  {\ifcsname d!#1\endcsname
 \donetrue
   \else
 \donefalse
   \fi}

\testfeatureonce{10}{\ifdimen{34cm}{}{}}

10% faster ... anyhow, quite ugly code

And I thought you show us a Lua solution.

i'll have a look at why the normal one fails

\doifdimensionelse expects a dimension or a number but not characters.

\starttext

\doifdimensionelse{12pt}{yes}{no} % works

\doifdimensionelse{0}{yes}{no} % works

\doifdimensionelse{}{yes}{no} % fails

\doifdimensionelse{`a}{yes}{no} % works

\doifdimensionelse{a}{yes}{no} % fails

\stoptext

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
___


Re: [NTG-context] new contextbeta distribution broken?

2010-03-20 Thread Hans Hagen

On 20-3-2010 20:11, Wolfgang Schuster wrote:

Am 20.03.10 18:49, schrieb Hans Hagen:

\chardef\d!pt\plusone
\chardef\d!pc\plusone
\chardef\d!in\plusone
\chardef\d!bp\plusone
\chardef\d!cm\plusone
\chardef\d!mm\plusone
\chardef\d!dd\plusone
\chardef\d!cc\plusone
\chardef\d!sp\plusone
\chardef\d!ex\plusone
\chardef\d!em\plusone

\def\test@@ifdimunt#1%
{\ifcsname d!#1\endcsname
\donetrue
\else
\donefalse
\fi}

\testfeatureonce{10}{\ifdimen{34cm}{}{}}

10% faster ... anyhow, quite ugly code

And I thought you show us a Lua solution.

i'll have a look at why the normal one fails

\doifdimensionelse expects a dimension or a number but not characters.

\starttext

\doifdimensionelse{12pt}{yes}{no} % works

\doifdimensionelse{0}{yes}{no} % works

\doifdimensionelse{}{yes}{no} % fails

\doifdimensionelse{`a}{yes}{no} % works

\doifdimensionelse{a}{yes}{no} % fails

\stoptext


i can bring the tex version (different approach btw) down to 0.625 
seconds while a lua variant does 1.310 seconds


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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
___


Re: [NTG-context] Stack overflow

2010-03-20 Thread Hans Hagen

On 20-3-2010 12:30, Andreas Schneider wrote:

Alain Delmotte wrote:


When I want to compile the file on which I am working, I get:
C:\Programmes\ConTeXt\tex\texmf-mswin\bin\mtxrun.lua:2161: stack overflow


The same happens to me, but only when I invoke context.exe. It works fine
with context.cmd. (The same holds true for mtxrun.exe vs. mtxrun.cmd and
probably others.)


can you add a print in line 2161 and see what path is reported?

function file.collapse_path(str)

print(str)

str = gsub(str,\\,/)
if find(str,/) then





-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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
___