Subject: bug#48524: 13.0.11; AUCTeX should not use LaTeX error message for non-LaTeX modes

From: jfbu <[email-masked]>
Date: Wed, 19 May 2021 18:16:32 +0200

Hi,

In tex-buf.el I see for example

        ("Use of [^ ]* doesn't match its definition." .
         "It's probably one of the picture-drawing commands, and you have used
    the wrong syntax for specifying an argument. If it's \\@array that
    doesn't match its definition, then there is something wrong in an
    @-expression in the argument of an array or tabular
    environment---perhaps a fragile command that is not \\protect'ed.")

And this is triggered for example by this Plain tex file

    \def\foo1{}
    \foo.
    \bye

But in the source for pdftex pdftex.web see at about line 9480

    @ @<Report an improper use...@>=
    begin print_err("Use of "); sprint_cs(warning_index);
    @.Use of x doesn't match...@>
    print(" doesn't match its definition");
    help4("If you say, e.g., `\def\a1{...}', then you must always")@/
      ("put `1' after `\a', since control sequence names are")@/
      ("made up of letters only. The macro here has not been")@/
      ("followed by the required stuff, so I'm ignoring it.");
    error; return;
    end

I am of the opinion that AUCTeX should use the original Knuth
error messages.

Even for LaTeX the above error message is now really dated,
but this is not topic of this ticket.

I understand this is some work to extract from pdftex.web the
errors (perhaps someone in the last 30+ years or so has done so,
regarding the Knuth original messages, as pdftex adds some of its
own) and I am opening this bug ticket only for reference as for many
many years each time I have had errors playing around with 
TeX I have always been slightly annoyed to see LaTeX specific
error messages. As a result, I most of the time execute etex or pdftex
in a Terminal bypassing auctex.

    ! Use of \foo doesn't match its definition.
    l.27     \foo.
                  
    ? h
    If you say, e.g., `\def\a1{...}', then you must always
    put `1' after `\a', since control sequence names are
    made up of letters only. The macro here has not been
    followed by the required stuff, so I'm ignoring it.

Best,