ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* context command line interface documentation?
@ 2019-11-12 11:14 Philipp A.
  2019-11-12 12:21 ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Philipp A. @ 2019-11-12 11:14 UTC (permalink / raw)
  To: ConTeXt Mainling List


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

Hi,

I want context to shut up, specifically the “mkiv lua stats” at the end are
useless to me and make me scroll up for actual error messages, but better
would be to just stop after the first error.
I consulted the --help docs but found them entirely unhelpful. Also there’s
no examples. As doing it wrong results in no error message or indeed any
kind of effect, I was in the dark.

First I consulted the --help and found: “--silent=list disable logcatgories
(show list with --showlogcategories)”. What’s a “list”? comma separated? Do
I need string delimiters?
Whatever, executing “context --showlogcategories” tells me the log category
“mkiv lua stats” exists, so: “context --silent='mkiv lua stats' doc.tex”
does … nothing, the lua stats are still there mocking me.

OK, let’s do what you do when there’s no documentation; dive in the code:
“grep -C3 'batchmode'
/usr/share/texmf-dist/scripts/context/lua/mtx-context.lua”
This tells me that there’s a “errorstopmode” in luatex but no way to make
the context script invoke “luatex -interaction=errorstopmode”, great.
Diving deeper, “setblocked” in mtxtun.lua checks if --silent=all is
specified, nice! But that affects everything EXCEPT for the “mkiv lua
stats”.

Therefore the two most useful ways to run context (--errorstopmode and
--silent='mkiv lua stats') seem impossible unless one writes a wrapper
script.
Would be cool to have this fixed. And to have actually useful documentation
instead of having to deep-dive into mtxrun.lua.

Best, Philipp

PS: I filed http://tracker.luatex.org/view.php?id=1014 and
http://tracker.luatex.org/view.php?id=1015

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

[-- Attachment #2: Type: text/plain, Size: 493 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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-12 11:14 context command line interface documentation? Philipp A.
@ 2019-11-12 12:21 ` Hans Hagen
  2019-11-12 17:35   ` Henning Hraban Ramm
  2019-11-18 22:11   ` Philipp A.
  0 siblings, 2 replies; 8+ messages in thread
From: Hans Hagen @ 2019-11-12 12:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/12/2019 12:14 PM, Philipp A. wrote:
> Hi,
> 
> I want context to shut up, specifically the “mkiv lua stats” at the end 
> are useless to me and make me scroll up for actual error messages, but 
> better would be to just stop after the first error.
> I consulted the --help docs but found them entirely unhelpful. Also 
> there’s no examples. As doing it wrong results in no error message or 
> indeed any kind of effect, I was in the dark.

context --silent -nostatistics

context quits at the first error as recovering is (1) seldom useful, (2) 
can interfere badly with tex/mp/lua and make things worse), (3) context 
tries to show a bit more precise location where the erro comes from (not 
always easy in tex) ... some of these modes originate in paper terminal 
times and it's very unlikely that context will change it's current way 
of doing things

> First I consulted the --help and found: “--silent=list disable 
> logcatgories (show list with --showlogcategories)”. What’s a “list”? 
> comma separated? Do I need string delimiters?

comma separated and only quoted when spaces (as usual with spaces)

> Whatever, executing “context --showlogcategories” tells me the log 
> category “mkiv lua stats” exists, so: “context --silent='mkiv lua stats' 
> doc.tex” does … nothing, the lua stats are still there mocking me.
> 
> OK, let’s do what you do when there’s no documentation; dive in the 
> code: “grep -C3 'batchmode' 
> /usr/share/texmf-dist/scripts/context/lua/mtx-context.lua”
> This tells me that there’s a “errorstopmode” in luatex but no way to 
> make the context script invoke “luatex -interaction=errorstopmode”, great.
> Diving deeper, “setblocked” in mtxtun.lua checks if --silent=all is 
> specified, nice! But that affects everything EXCEPT for the “mkiv lua 
> stats”.

grepping for stats will bring you to nostats and nostatistics and 
"context --help --expert" shows that flag too

> Therefore the two most useful ways to run context (--errorstopmode and 
> --silent='mkiv lua stats') seem impossible unless one writes a wrapper 
> script.
> Would be cool to have this fixed. And to have actually useful 
> documentation instead of having to deep-dive into mtxrun.lua.

remarks like the last one are very unlikely to trigger people to write 
additional documentation (a manual or wiki page) ... context comes for 
free, support comes for free ... there is not much one can demand i guess

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 / 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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-12 12:21 ` Hans Hagen
@ 2019-11-12 17:35   ` Henning Hraban Ramm
  2019-11-18 22:11   ` Philipp A.
  1 sibling, 0 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2019-11-12 17:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 2019-11-12 um 13:21 schrieb Hans Hagen <j.hagen@xs4all.nl>:
>> Would be cool to have this fixed. And to have actually useful documentation instead of having to deep-dive into mtxrun.lua.
> 
> remarks like the last one are very unlikely to trigger people to write additional documentation (a manual or wiki page) ... context comes for free, support comes for free ... there is not much one can demand i guess

Also there is texmf-context/doc/context/documents/general/manuals/tools-mkiv.pdf


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-12 12:21 ` Hans Hagen
  2019-11-12 17:35   ` Henning Hraban Ramm
@ 2019-11-18 22:11   ` Philipp A.
  2019-11-19  9:16     ` Hans Hagen
  2019-11-19  9:31     ` Hans Hagen
  1 sibling, 2 replies; 8+ messages in thread
From: Philipp A. @ 2019-11-18 22:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Hans,

Very sorry that it was phrased so negatively. I like ConTeXt enough that I
wrote my master’s thesis in it, and am now writing my doctor’s thesis in it.
I had a long day that day and didn’t expect to have to dive so deep to find
out what I want is impossible. I think my language mostly reflected my
thought process going through it, not lack of respect towards your work.
I hope my bug report here is still helpful and provides all information
necessary to improve ConTeXt, and would like to help if there’s an easy way
to contribute (Pull requests?)

context --silent -nostatistics
>

Thank you! I see it’s in the “experts” section in mtx-context.xml. I added
it to the wiki, as it seems the most immediately useful (and non-experty)
among those options.
I think it would be best if the help would just be generated from that file
to reduce the sources of truth in existence.


> context quits at the first error as recovering is (1) seldom useful, (2)
> can interfere badly with tex/mp/lua and make things worse), (3) context
> tries to show a bit more precise location where the erro comes from (not
> always easy in tex) ... some of these modes originate in paper terminal
> times and it's very unlikely that context will change it's current way of
> doing things
>

What you’re describing is the behavior I’m trying to achieve. The error
location reporting works for me, but context will still continue after an
error for me:
If I don’t specify --nonstopmode or so it’ll try to recover, and even when
I specify it, there will be other output after the error.

>  What’s a “list”? comma separated? Do I need string delimiters?
>
> comma separated and only quoted when spaces (as usual with spaces)
>

You mean quoted as in “to prevent my terminal from interpreting it wrong”,
right?
Not that the script actually expects quotes in argv?

grepping for stats will bring you to nostats and nostatistics and "context
> --help --expert" shows that flag too
>

All of which is undocumented. I’d like to help here, so I added it to the
wiki, but it would be useful to mention this in --help, too!

remarks like the last one are very unlikely to trigger people to write
> additional documentation (a manual or wiki page) ... context comes for
> free, support comes for free ... there is not much one can demand i guess
>
> Hans
>

Again, I’m really sorry! I’d like to help, but I don’t have the time
currently for more than drive-by pull requests and wiki edits. I’m doing
the latter and if the former is possible, I’ll try my hand. Is it?

Best, Philipp

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

[-- Attachment #2: Type: text/plain, Size: 493 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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-18 22:11   ` Philipp A.
@ 2019-11-19  9:16     ` Hans Hagen
  2019-11-19  9:31     ` Hans Hagen
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2019-11-19  9:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Philipp A., Pavneet Arora

Hi,

> What you’re describing is the behavior I’m trying to achieve. The error 
> location reporting works for me, but context will still continue after 
> an error for me:
> If I don’t specify --nonstopmode or so it’ll try to recover, and even 
> when I specify it, there will be other output after the error.

What version are you running? The latest lmtx should quite after an 
error. When no proper document can be created it will provide an error 
document.

> Not that the script actually expects quotes in argv?

The command line parsing is kind of special

- lua(metatex) itself has to intercept some flags and act on it
- the context (and mtxrun) script also need them (as script)
- some passed arguments are used to drive the process
- and potentially common flags should not interfere

--foo
--foo=bar
--foo="bar bar"

filename
"file name"

should all work (also with special characters but of course there can be 
issues i don't know about); so intrepretation happens in the engine, in 
mtxrun (script0, context (script), context (macro package)

when you run context you can see the exact call to luatex and how 
arguments get passed (some get prefixed with "c:")

concerning the wiki, best discuss that with Pavneet (in cc) as he's in 
charge of (re)organizing the wiki; if you have suggestions for any of 
the manuals in the distribution that deal with this, you can just sedn 
them to me

thanks,

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 / 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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-18 22:11   ` Philipp A.
  2019-11-19  9:16     ` Hans Hagen
@ 2019-11-19  9:31     ` Hans Hagen
  2019-11-19 19:10       ` Philipp A.
  1 sibling, 1 reply; 8+ messages in thread
From: Hans Hagen @ 2019-11-19  9:31 UTC (permalink / raw)
  To: ntg-context

Concerning errors, one can say

context --directives="system.showerror" somefile

and on an error an html file is generated (old feature) ... i still 
couldn't figure out a way to reliable launch a browser and target the 
same tab (so autolaunch is disabled for now)

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 / 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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-19  9:31     ` Hans Hagen
@ 2019-11-19 19:10       ` Philipp A.
  2019-11-20  8:29         ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Philipp A. @ 2019-11-19 19:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

That’s pretty cool, overriding that hook allows to build a ConTeXt language
server for editors like VS Code!
https://microsoft.github.io/language-server-protocol/

Sadly I’m still a bit lost: When calling `context file_with_error.tex`, I
see “This is LuaTeX, Version 1.10 … tex error on line … ?” and it waits for
input.
You said that context stops when encountering an error which isn’t the case
for me. Any ideas why?

Best, Philipp

Am Di., 19. Nov. 2019 um 10:34 Uhr schrieb Hans Hagen <j.hagen@xs4all.nl>:

> Concerning errors, one can say
>
> context --directives="system.showerror" somefile
>
> and on an error an html file is generated (old feature) ... i still
> couldn't figure out a way to reliable launch a browser and target the
> same tab (so autolaunch is disabled for now)
>
> 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 /
> 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
>
> ___________________________________________________________________________________
>

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

[-- Attachment #2: Type: text/plain, Size: 493 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] 8+ messages in thread

* Re: context command line interface documentation?
  2019-11-19 19:10       ` Philipp A.
@ 2019-11-20  8:29         ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2019-11-20  8:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Philipp A.

On 11/19/2019 8:10 PM, Philipp A. wrote:
> That’s pretty cool, overriding that hook allows to build a ConTeXt 
> language server for editors like VS Code! 
> https://microsoft.github.io/language-server-protocol/

i looked at that a while ago but imo the whole server model is pretty 
complex (maintaince and compatibility hell) for something as simple as 
an edit-run-cycle .. i wait till vscode has a simple filetype related 
hit-this-key-and-run feature (last time i checked it was global for all 
file types)

> Sadly I’m still a bit lost: When calling `context file_with_error.tex`, 
> I see “This is LuaTeX, Version 1.10 … tex error on line … ?” and it 
> waits for input.
> You said that context stops when encountering an error which isn’t the 
> case for me. Any ideas why?

i'm talking lmtx

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 / 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] 8+ messages in thread

end of thread, other threads:[~2019-11-20  8:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12 11:14 context command line interface documentation? Philipp A.
2019-11-12 12:21 ` Hans Hagen
2019-11-12 17:35   ` Henning Hraban Ramm
2019-11-18 22:11   ` Philipp A.
2019-11-19  9:16     ` Hans Hagen
2019-11-19  9:31     ` Hans Hagen
2019-11-19 19:10       ` Philipp A.
2019-11-20  8:29         ` 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).