adityam / filter

ConTeXt module to process contents of a start-stop environment through an external program
45 stars 10 forks source link

Minimum working example of t-vim #51

Closed champignoom closed 2 years ago

champignoom commented 2 years ago

The concatenation of the scattered code in vim-README does not form a valid showcase. In particular, with shell_escape = t set in textmf.cnf, the following code produces [[output file missing on my machine:

\usemodule[vim]
\definevimtyping [RUBY]  [syntax=ruby]
\starttext
\startRUBY
  # Wow, my first ruby program
  print("Hello World")
\stopRUBY
\stoptext

It would be nice to have a MWE for t-vim. Besides,

... This data, along with the filter command, is useful for debugging what whet wrong. (END)

things are hardly useful without explanations of how they could be useful.

champignoom commented 2 years ago

Never mind, I missed \setupvimtyping[vimcommand=nvim].

But still, MWE could improve the credibility of the instructions, and it would be nice to have something like "shell error: command not found: vim".

adityam commented 2 years ago

The vim module (or the filter module in general) doesn't check for installed programs. I am not sure how to check that.

The shell will give an error, but that is easy to miss. For example, in zsh, I see:

close source    > level 2, order 7, name 't-vim.tex'
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
t-filter        > cached output file 'test-temp-C-0.vimout' missing. Rerunning filter
sh: line 1: bvim: command not found
t-filter        > file 'test-temp-C-0.vimout' cannot be found
t-filter        > current filter : C
t-filter        > base file : test-temp-C-0
t-filter        > input file : test-temp-C-0.tmp
t-filter        > output file : test-temp-C-0.vimout
backend         > xmp > using file '/opt/luametatex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1, subpage 1

Note the line starting with sh: It says bvim: command not found (bvim, because I changed the program name to use a program name not on my system).

champignoom commented 2 years ago

sh: ... vim: command not found is right there indeed.

So this is more of a problem of context logging than of t-filter. Might be off-topic here, but is there/could there be a separation of logging levels (like error>warning>info>debugging) for context?