texjporg / tex-jp-build

Minimum source repository to build Japanese TeX processing tools
23 stars 6 forks source link

eptex.ech: \showmode follows \showstream #130

Closed aminophen closed 2 years ago

aminophen commented 2 years ago

TL2022 で追加見込みの \showstream プリミティブ(eptexdoc には記載済)について,pTeX には「\show 系プリミティブ」として \showmode があるので,出力ストリームに追随するようにしてみました。

%#!eptex
\newwrite\myoutstream
\immediate\openout\myoutstream="infofile"
\showstream=\myoutstream
% From now on, \show... commands are redirected to "infofile.tex".
%
% === actual tests ===
\showboxdepth10000
\showboxbreadth10000
%
\show\TeX
\setbox0=\hbox{A, B and C\showlists}\showbox0
\showthe\count0
{{\showgroups}}
\ifnum0=0 \showifs \fi
\showtokens{\A\B\C}
\ifx\showmode\undefined\else \showmode \fi
%
% === invalid usages ===
\showbox\relax
\showthe\ABC \relax
% => ! Undefined control sequence.
\showtokens A}\relax
% => ! Missing { inserted.
%
\showstream=-1
% -1 is never a open file and therefore restores
% normal \show... behavior.
\immediate\closeout\myoutstream
%
\end