[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Weird TeX behaviour with predumped format
From: |
Gavin Smith |
Subject: |
Weird TeX behaviour with predumped format |
Date: |
Sun, 25 Dec 2022 18:04:28 +0000 |
I found some strange behaviour when testing Texinfo as a pre-dumped
TeX format
If the format file gives newline an active definition, the expansion
can be used for the filename when loading a file with the format. Here's
an attempt at a minimal example:
$ cat format.tex
\input plain
\def\restorenl{\catcode`\^^M=5}%
\catcode`\^^M=13 %
\def^^M{X\restorenl \relax}%
$ cat test.tex
simple input file
\end
$ tex -ini format.tex '\dump'
This is TeX, Version 3.14159265 (TeX Live 2019/Debian) (INITEX)
(./format.tex (/usr/share/texlive/texmf-dist/tex/plain/base/plain.tex
Preloading the plain format: codes, registers, parameters, fonts, more fonts,
macros, math definitions, output routines, hyphenation
(/usr/share/texlive/texmf-dist/tex/generic/hyphen/hyphen.tex)))
Beginning to dump on file format.fmt
(preloaded format=format 2022.12.25)
2025 strings of total length 29175
5002 memory locations dumped; current usage is 110&4889
927 multiletter control sequences
[... fonts omitted ...]
14787 words of font info for 50 preloaded fonts
14 hyphenation exceptions
Hyphenation trie of length 6075 has 181 ops out of 35111
181 for language 0
No pages of output.
Transcript written on format.log.
$ tex '&format' test
This is TeX, Version 3.14159265 (TeX Live 2019/Debian) (preloaded
format=format)
! I can't find file `testX'.
<to be read again>
\catcode
\restorenl ->\catcode
`\^^M=5
^^M->X\restorenl
\relax
<*> &format test
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
As you can see, the file was called "test.tex" but it is looking for a file
called "testX". The same happens with the ** prompt of TeX:
$ tex
This is TeX, Version 3.14159265 (TeX Live 2019/Debian) (preloaded format=tex)
**&format test
! I can't find file `testX'.
<to be read again>
\catcode
\restorenl ->\catcode
`\^^M=5
^^M->X\restorenl
\relax
<*> &format test
(Press Enter to retry, or Control-D to exit)
Please type another input file name:
It appears as if the line on the ** prompt is being expanded, including
the newline at the end. I do not remember having this happen before and
I likely had a different version of TeX installed last time I tested this.
I wondered if this should be reported to the TeX Live developers. Does
anybody know if there have been recent changes in this area?
It will probably be good to remove any support for Texinfo as a
pre-dumped format anyway, as it is an extra complication with minimal
speed benefits. It appears to have been broken for over 5 years.
- Weird TeX behaviour with predumped format,
Gavin Smith <=