[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: texi2dvi: (easy) request to make errorstopmode an option

From: Marius Hofert
Subject: Re: texi2dvi: (easy) request to make errorstopmode an option
Date: Tue, 22 Dec 2020 20:06:36 +0000


yes, that works as expected.


From: Gavin Smith <gavinsmith0123@gmail.com>
Sent: Tuesday, December 22, 2020 14:29
To: Marius Hofert <marius.hofert@uwaterloo.ca>
Cc: bug-texinfo@gnu.org <bug-texinfo@gnu.org>
Subject: Re: texi2dvi: (easy) request to make errorstopmode an option
On Wed, Dec 09, 2020 at 05:11:43PM +0000, Marius Hofert wrote:
> Hi Gavin,
> thanks for your quick reply.
> Why this should happen: see https://tex.stackexchange.com/questions/574128/how-to-get-texi2pdf-to-stop-on-the-first-error-again/574138?noredirect=1#comment1446291_574138 for how this came up.
> When it should happen and name of option: When an option is provided. I believe it used to be the default to stop on first error (see also the above post), but changing the default is most likely to intrusive. But at least having the option to stop on the first error would be great, so one could say it should happen once a new option (e.g., --stop-on-error or --stop-on-first-error) is provided.
> For auxiliary files that do not exist: I'd also say that texi2dvi should stop immediately then (it's a hard stop on the first kind of more drastic 'error' which I feel a non-existing auxiliary file should be counted as), but there could be finer control over it (if documented correctly there should be no problem).
> Thanks & cheers,
> Marius

I have finally gotten around to looking at this.

The change was made in commit d6c3343741 on 2019-03-31.

IIRC the change was part of a plan to deal with a problem with Texinfo
auxiliary files using a different escape character (\) to that used (@) by
Texinfo main input files.   This was a bad decision made decades ago AFAIK,
and one which we still haven't managed to deal with.

The idea was that if reading one of the auxiliary files led to an
error, then this could have been due to the wrong escape character
(\) appearing in the file.  texi2dvi was to run TeX again in case
the auxiliary files had changed to have the right escape character (@).

We never made the change because existing versions of texi2dvi at the time
didn't recognize files with the new escape character and the effect of this
was that manuals would be produced without indices.  We still hope to make
the change at some point when newer versions are prevalent enough.  It
should be as simple as deleting the line "\set txiindexescapeisbackslash"
in texinfo.tex to change over to using @.

I tested this plan for automatic upgrade of the auxiliary files with a slight
change to texi2dvi:

diff --git a/util/texi2dvi b/util/texi2dvi
index 8b7481631..a05e7a872 100755
--- a/util/texi2dvi
+++ b/util/texi2dvi
@@ -885,11 +885,8 @@ make_tex_cmd ()
   # Tell TeX to allow running external executables
   test -n "$shell_escape" && tex_cmd="$tex_cmd $shell_escape"
-  # Run without interaction.
-  # \batchmode does not show terminal output at all, so we don't
-  # want that.  And even in batch mode, TeX insists on having input
-  # from the user.  Close its stdin to make it impossible.
-  tex_cmd="$tex_cmd </dev/null '${escape}nonstopmode'"
+  # Run without interaction, stopping at the first error.
+  tex_cmd="$tex_cmd </dev/null"

and this appears to work fine.  I installed this change in commit 140832bea.

Would you be able to test this to see if this does what you want?

As I said, it's an easy request to make, but not necessarily that easy to
do properly.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]