Re: [NTG-context] \typefile not including file and returning success

2023-02-21 Thread Marco Patzer via ntg-context
On Wed, 21 Dec 2022 13:17:15 +0100
Hans Hagen via ntg-context  wrote:

> The next upload will have:
> 
> \adddefaultsuffix[foo,{},crap]
> \adddefaultsuffix[{}]
> 
> \typefile{./crapcrap}
> \typefile{crapcrap}
> 
> which someone has to document on the wiki

Apologies for taking so long. But I just now tested your fix and
wanted to remove the absolute paths from my document and found that
either your fix is not working or I'm doing something wrong
(probably the latter). Example:

# create file “bar”
echo Bar > bar

%% \adddefaultsuffix[foo,{},crap,bar]
\adddefaultsuffix[{}]

\starttext
  Foo
  \typefile{bar}
\stoptext

This does *not* include the file “bar”. As far as I understand:

%% searches for files with no extention
\adddefaultsuffix[{}]

%% searches for files with extension aa, bb, foobar,
%% e.g. file.aa, blurp.bb or example.foobar
\adddefaultsuffix[aa, bb, foobar]

But that's not how it behaves. Can you elaborate?


Marco

LMTX 2023.02.14 17:44
PS: When I get it to work, I'll document it on the wiki.
___
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
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-21 Thread Marco Patzer via ntg-context
On Wed, 21 Dec 2022 13:17:15 +0100
Hans Hagen via ntg-context  wrote:

> > But context returning success when it clearly doesn't include the
> > file is unfortunate. The missing file might go completely unnoticed.
> > I'd expect an error there.  
> The next upload will have:
> 
> \adddefaultsuffix[foo,{},crap]
> \adddefaultsuffix[{}]
> 
> \typefile{./crapcrap}
> \typefile{crapcrap}

Thanks Hans for looking into that. I'll play with it after the next
update.

> which someone has to document on the wiki

Wilco

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


Re: [NTG-context] \typefile not including file and returning success

2022-12-21 Thread Hans Hagen via ntg-context

On 12/17/2022 6:27 PM, Marco via ntg-context wrote:

On Sat, 17 Dec 2022 17:43:48 +0100
Otared Kavian  wrote:

Thanks for your quick reply.


It seems that one can fool ConTeXt into typing a file without suffix
by giving the path to that file…


That works, I can confirm.


\typefile{/Users/kavian/Context/essais/mkiv/bar-bis}


Hard-coded absolute paths in TeX files are something I avoid, but I
assume that's just for demonstration here.


\typefile{./bar-bis}


That works as well. It's a workaround at least.

But context returning success when it clearly doesn't include the
file is unfortunate. The missing file might go completely unnoticed.
I'd expect an error there.

The next upload will have:

\adddefaultsuffix[foo,{},crap]
\adddefaultsuffix[{}]

\typefile{./crapcrap}
\typefile{crapcrap}

which someone has to document on the wiki

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
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco Patzer via ntg-context
On Sat, 17 Dec 2022 10:41:11 -0800
skyhorse--- via ntg-context  wrote:

> The context wiki says:
>   "When no file extension is specified the extension .tex is assumed."

It's not on the page for typefile:

  https://wiki.contextgarden.net/Command/typefile

And that surely makes sense for TeX (input) files, but not \type'ed
files, which are usually not TeX files.

\startnitpicking

The message

  verbatims   > file 'bar' does not exist

is wrong, the file “bar” exists. Displaying

  verbatims   > file 'bar.txt' does not exist

\stopnitpicking

would be correct. But as I said, assuming \type'ed files are .tex
files does not make sense, IMO.

> By chance, do you have a file named "bar.tex" that would prevent this
> from being an error?

No. It just doesn't produce an error here (or non-success exit code
for that matter).

using LMTX:  2022.12.15 18:12

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


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread skyhorse--- via ntg-context

The context wiki says:
  "When no file extension is specified the extension .tex is assumed."

Yes an error message should be displayed.
By chance, do you have a file named "bar.tex" that would prevent this from 
being an error?

skyhorse


-

Otared Kavian via ntg-context  wrote:

> Hi Marco,
> 
> If I create a file named « bar.txt » then
> 
> \starttext
> Nothing to say\dots
> 
> \typefile{bar.txt}
> 
> \stoptext
> 
> gives the correct result. However ConTeXt seems to dislike \typefile{bar} 
> when the filename has no suffix.
> 
> Best regards : Otared
> 
> > On 17 Dec 2022, at 16:06, Marco Patzer via ntg-context  
> > wrote:
> > 
> > Hi!
> > 
> > In the following example the file “bar” is not included:
> > 
> > # create file “bar”
> > echo Bar > bar
> > 
> > # t.tex
> > \starttext
> >  Foo
> >  \typefile{bar}
> > \stoptext
> > 
> > Then run
> > 
> >  context --errors='*' t.tex
> > 
> > The text “bar” is not included in the PDF, only Foo is. The log file
> > shows:
> > 
> >  verbatims   > file 'bar' does not exist
> > 
> > However, the file “bar” clearly does exist. Furthermore, context
> > exits with no error in the log file and a successful exit value:
> > 
> >  context --errors='*' t.tex > /dev/null; echo $?
> >  0
> > 
> > Is this working as intended?
> > 
> > Marco
> > ___
> > 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
> > ___
> 
> Otared Kavian
> e-mail: ota...@gmail.com
> Phone: +33 6 88 26 70 95
> 
> 
> 
> ___
> 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
> ___
___
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
___


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco via ntg-context
On Sat, 17 Dec 2022 17:43:48 +0100
Otared Kavian  wrote:

Thanks for your quick reply.

> It seems that one can fool ConTeXt into typing a file without suffix
> by giving the path to that file…

That works, I can confirm.

> \typefile{/Users/kavian/Context/essais/mkiv/bar-bis}

Hard-coded absolute paths in TeX files are something I avoid, but I
assume that's just for demonstration here.

> \typefile{./bar-bis}

That works as well. It's a workaround at least.

But context returning success when it clearly doesn't include the
file is unfortunate. The missing file might go completely unnoticed.
I'd expect an error there.

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


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco Patzer via ntg-context
On Sat, 17 Dec 2022 16:25:01 +0100
Otared Kavian via ntg-context  wrote:

> If I create a file named « bar.txt » then
> 
> \starttext
> Nothing to say\dots
> 
> \typefile{bar.txt}
> 
> \stoptext
> 
> gives the correct result.

I can confirm that.

> However ConTeXt seems to dislike \typefile{bar} when the filename
> has no suffix.

Is there a way around it? Traditionally there are plenty of files
without suffix (e.g. README, Makefile, configure, etc.)

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


Re: [NTG-context] \typefile not including file and returning success

2022-12-17 Thread Otared Kavian via ntg-context
Hi Marco,

If I create a file named « bar.txt » then

\starttext
Nothing to say\dots

\typefile{bar.txt}

\stoptext

gives the correct result. However ConTeXt seems to dislike \typefile{bar} when 
the filename has no suffix.

Best regards : Otared

> On 17 Dec 2022, at 16:06, Marco Patzer via ntg-context  
> wrote:
> 
> Hi!
> 
> In the following example the file “bar” is not included:
> 
> # create file “bar”
> echo Bar > bar
> 
> # t.tex
> \starttext
>  Foo
>  \typefile{bar}
> \stoptext
> 
> Then run
> 
>  context --errors='*' t.tex
> 
> The text “bar” is not included in the PDF, only Foo is. The log file
> shows:
> 
>  verbatims   > file 'bar' does not exist
> 
> However, the file “bar” clearly does exist. Furthermore, context
> exits with no error in the log file and a successful exit value:
> 
>  context --errors='*' t.tex > /dev/null; echo $?
>  0
> 
> Is this working as intended?
> 
> Marco
> ___
> 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
> ___

Otared Kavian
e-mail: ota...@gmail.com
Phone: +33 6 88 26 70 95



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


[NTG-context] \typefile not including file and returning success

2022-12-17 Thread Marco Patzer via ntg-context
Hi!

In the following example the file “bar” is not included:

# create file “bar”
echo Bar > bar

# t.tex
\starttext
  Foo
  \typefile{bar}
\stoptext

Then run

  context --errors='*' t.tex

The text “bar” is not included in the PDF, only Foo is. The log file
shows:

  verbatims   > file 'bar' does not exist

However, the file “bar” clearly does exist. Furthermore, context
exits with no error in the log file and a successful exit value:

  context --errors='*' t.tex > /dev/null; echo $?
  0

Is this working as intended?

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