ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \typefile not including file and returning success
@ 2022-12-17 15:06 Marco Patzer via ntg-context
  2022-12-17 15:25 ` Otared Kavian via ntg-context
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Patzer via ntg-context @ 2022-12-17 15:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-17 15:06 \typefile not including file and returning success Marco Patzer via ntg-context
@ 2022-12-17 15:25 ` Otared Kavian via ntg-context
  2022-12-17 15:47   ` Marco Patzer via ntg-context
  2022-12-17 18:41   ` skyhorse--- via ntg-context
  0 siblings, 2 replies; 9+ messages in thread
From: Otared Kavian via ntg-context @ 2022-12-17 15:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

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 <ntg-context@ntg.nl> 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: otared@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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-17 15:25 ` Otared Kavian via ntg-context
@ 2022-12-17 15:47   ` Marco Patzer via ntg-context
       [not found]     ` <484EE253-BF9E-4E91-94B8-0D627F334606@gmail.com>
  2022-12-17 18:41   ` skyhorse--- via ntg-context
  1 sibling, 1 reply; 9+ messages in thread
From: Marco Patzer via ntg-context @ 2022-12-17 15:47 UTC (permalink / raw)
  To: Otared Kavian via ntg-context; +Cc: Marco Patzer, Otared Kavian

On Sat, 17 Dec 2022 16:25:01 +0100
Otared Kavian via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
       [not found]     ` <484EE253-BF9E-4E91-94B8-0D627F334606@gmail.com>
@ 2022-12-17 17:27       ` Marco via ntg-context
  2022-12-21 12:17         ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 9+ messages in thread
From: Marco via ntg-context @ 2022-12-17 17:27 UTC (permalink / raw)
  To: Otared Kavian via ntg-context; +Cc: Marco

On Sat, 17 Dec 2022 17:43:48 +0100
Otared Kavian <otared@gmail.com> 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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-17 15:25 ` Otared Kavian via ntg-context
  2022-12-17 15:47   ` Marco Patzer via ntg-context
@ 2022-12-17 18:41   ` skyhorse--- via ntg-context
  2022-12-17 19:39     ` Marco Patzer via ntg-context
  1 sibling, 1 reply; 9+ messages in thread
From: skyhorse--- via ntg-context @ 2022-12-17 18:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: skyhorse


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 <ntg-context@ntg.nl> 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 <ntg-context@ntg.nl> 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: otared@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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-17 18:41   ` skyhorse--- via ntg-context
@ 2022-12-17 19:39     ` Marco Patzer via ntg-context
  0 siblings, 0 replies; 9+ messages in thread
From: Marco Patzer via ntg-context @ 2022-12-17 19:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

On Sat, 17 Dec 2022 10:41:11 -0800
skyhorse--- via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-17 17:27       ` Marco via ntg-context
@ 2022-12-21 12:17         ` Hans Hagen via ntg-context
  2022-12-21 13:03           ` Marco Patzer via ntg-context
  2023-02-21 13:12           ` Marco Patzer via ntg-context
  0 siblings, 2 replies; 9+ messages in thread
From: Hans Hagen via ntg-context @ 2022-12-21 12:17 UTC (permalink / raw)
  To: ntg-context; +Cc: Hans Hagen

On 12/17/2022 6:27 PM, Marco via ntg-context wrote:
> On Sat, 17 Dec 2022 17:43:48 +0100
> Otared Kavian <otared@gmail.com> 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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-21 12:17         ` Hans Hagen via ntg-context
@ 2022-12-21 13:03           ` Marco Patzer via ntg-context
  2023-02-21 13:12           ` Marco Patzer via ntg-context
  1 sibling, 0 replies; 9+ messages in thread
From: Marco Patzer via ntg-context @ 2022-12-21 13:03 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Marco Patzer

On Wed, 21 Dec 2022 13:17:15 +0100
Hans Hagen via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

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

* Re: \typefile not including file and returning success
  2022-12-21 12:17         ` Hans Hagen via ntg-context
  2022-12-21 13:03           ` Marco Patzer via ntg-context
@ 2023-02-21 13:12           ` Marco Patzer via ntg-context
  1 sibling, 0 replies; 9+ messages in thread
From: Marco Patzer via ntg-context @ 2023-02-21 13:12 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Marco Patzer

On Wed, 21 Dec 2022 13:17:15 +0100
Hans Hagen via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

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

end of thread, other threads:[~2023-02-21 13:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-17 15:06 \typefile not including file and returning success Marco Patzer via ntg-context
2022-12-17 15:25 ` Otared Kavian via ntg-context
2022-12-17 15:47   ` Marco Patzer via ntg-context
     [not found]     ` <484EE253-BF9E-4E91-94B8-0D627F334606@gmail.com>
2022-12-17 17:27       ` Marco via ntg-context
2022-12-21 12:17         ` Hans Hagen via ntg-context
2022-12-21 13:03           ` Marco Patzer via ntg-context
2023-02-21 13:12           ` Marco Patzer via ntg-context
2022-12-17 18:41   ` skyhorse--- via ntg-context
2022-12-17 19:39     ` Marco Patzer 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).