On Thu, Mar 10, 2022 at 9:25 AM Ikumi Keita <ikumi@ikumi.que.jp> wrote:
Hello LuaTeX developers,

I have a few questions I'd like to ask you. In log message, luatex
engine produces slightly different error context from what pdftex does.
Here is a sample code:
----------------------------------------------------------------------
Nullam eu ante vel est convallis dignissim. } Nulla posuere.
\bye
----------------------------------------------------------------------
When I process this file by luatex, it results in the following error:
------ luatex result -------------------------------------------------
! Too many }'s.
l.1 Nullam eu ante vel est convallis dignissim. }
                                                Nulla posuere.
----------------------------------------------------------------------
On the other hand, pdftex results in:
------ pdftex result -------------------------------------------------
! Too many }'s.
l.1 Nullam eu ante vel est convallis dignissim. }
                                                  Nulla posuere.
----------------------------------------------------------------------
The output of luatex is shifted by two characters compared with that of
pdftex. (I'm using TeX Live 2021.)

This discrepancy confuses preview-latex (subsystem of AUCTeX), which
depends on the precise position of the log messages:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54200

I'm not sure whether this behavior is a bug or not, but is it something
I can expect to be fixed? If not, is there any workaround to make the
output the same as pdftex? (e.g. command line option)

I will check, but , in case , for sure no fix for this texlive:
1) the "write to stdout/stderr/log "  apparatus is complex/complicated, it's very easy to break something;
2) pdftex and luatex are different engines, it is expected that some outputs are anf will be different. Example:
%%test.tex
%% replace <TEXT> with 
%% a very long line in japanese text, longer than 79 "chars", without newline.
\wlog{%
<TEXT>
}
\bye
You can compare the log with pdftex and luatex.

These are the kind of things that should be addressed at the format level, if possible, or modifying the parsing method, if possible,
being open to the fact: "different engines, different output".
 
--
luigi