Subject: bug#36483: 12.1.2; 'lacheck' and 'chktex' results not recongnized by compilation mode when filename has spaces

From: Gustavo Barros <[email-masked]>
Date: Sun, 07 Jul 2019 09:48:46 -0300

Hi Ikumi Keita,

thank you for looking into this.

On Sun, Jul 07 2019, Ikumi Keita wrote:

> Hi Gustavo,
>
>>>>>> Gustavo Barros <[email-masked]> writes:
>> Currently 'lacheck' and 'chktex' results are not recognized as errors
>> or warnings by compilation mode if the document’s filename has
>> spaces.  This causes navigation through the errors with "C-x `"
>> ('next-error'), as described in AUCTeX’s documentation not to work.
>
> AUCTeX doesn't deal with the output of those commands (actually, all
> commands associated with `TeX-run-compile' in `TeX-command-list') at all
> and leaves them entirely to compilation-mode of Emacs.
>
> I think that compilation-mode is not ready for file names with spaces,
> at least for the output of lacheck and chktex.  It seems that the output
> format of these commands are delt with the following entry in
> `compilation-error-regexp-alist-alist':
>
>     (comma
>      "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\
> \\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 
> 3 (4))
>
> The regular expression in this entry excludes any space in the file name
> explicitly.  I'm not sure whether this exclusion is mandatory for robust
> operation of compilation-mode, but it might be worth for you to ask the
> maintainer of compilation-mode ([email-masked], according to the
> header of compile.el) to accept file names with spaces.
>
> Regards,
> Ikumi Keita

When I reported, I did fear this might ultimately rely on some change in 
compilation mode.  However, I still reported it here, because I thought that 
was the most appropriate place for me to do it.  Indeed, while I’m a regular 
user of AUCTeX, I’m deeply unacquainted with the workings of compilation mode. 
To the point I’d feel it inappropriate to simply ask the maintainer there to 
accept file names with spaces.

Still, even if the solution may rely on some change in compilation mode, the 
workings of AUCTeX in this respect do not correspond to the behavior described 
in AUCTeX’s documentation in a case where it is reasonable to expect it would.

Furthermore, error navigation for file names with spaces does work for other 
TeX commands which, as you mentioned, are equally left for compilation mode to 
handle.  It doesn’t just for 'lacheck' and 'chktex'.

I just happened to stumble upon this while rereading the documentation, 
tracked down the source of the problem, and reported where I saw it was 
fittest.  It’s really up to you to assess if this is relevant enough from 
AUCTeX’s perspective.  (And I really mean it, I just reported in a 
constructive spirit, without presumptions.)

That said, if you request me to report this to the compilation mode 
maintainers on your behalf, I’d be glad to be of assistance.  But I do believe 
I’d be a less effective and pertinent reporter there due to my own limitations 
regarding compilation mode.

Best regards,
Gustavo Barros.