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

From: jfbu <[email-masked]>
Date: Wed, 2 Jun 2021 13:52:41 +0200

Hi Keita,

Le 27/05/2021 à 14:09, Ikumi Keita a écrit :
> Hi Jean,
> 
>>>>>> jfbu <[email-masked]> writes:
>> I am of the opinion that AUCTeX should use the original Knuth
>> error messages.
> 
>> [...]
> 
>> The problem is to avoid in Plain TeX runs (or ConTeXt ? I am not
>> familiar with it) to have the auctex generated error help go into
>> LaTeX considerations which are not relevant to Plain TeX.
> 
> It seems that a similar topic was discussed before[1]. 

Indeed.  I was very articulate back then, I feel I have lost my
vocabulary since.

Tassilo's idea
> that AUCTeX allows the form (REGEX . FUNCTION) in addition to (REGEX .
> STRING) as entries in `TeX-error-description-list' would need some work,
> so the attached rough hack might be of some interest for you.
> 
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21595
> 

Sorry for late, I have now applied the patch and it seems
to do exactly what I was expecting.

I.e. this TeX file

\def\foo1{}
\foo.
\bye

triggers this error window on  C-c `

ERROR: Use of \foo doesn't match its definition.

--- TeX said ---
l.2     \foo.
              
--- HELP ---
 From the .log file...

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.

which is the actual text in the log file originating in pdftex
sources, copied over from Knuth original TeX.

Note : I applied the patch on my git clone, after
having pulled to get the latest commits, HEAD was
at 93d66d1a Adapt for Texinfo mode

For some reason I had to delete from the patch
the change to tex-jp.el

$ git apply patchlatexerrors
error: patch failed: tex-jp.el:538
error: tex-jp.el: patch does not apply

I suspect some encoding problem on my side (the buffer
indicated a "1" in bottom left) from gunzip

Best,

Jean-François