GNU bug report logs - #70816
29.2; Flymake fails in latex-mode when the buffer is narrowed

Previous Next

Package: emacs;

Reported by: Vangelis Evangelou <evangelou <at> gmail.com>

Date: Tue, 7 May 2024 07:58:02 UTC

Severity: normal

Found in version 29.2

Full log


Message #17 received at 70816 <at> debbugs.gnu.org (full text, mbox):

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: Vangelis Evangelou <evangelou <at> gmail.com>, 70816 <at> debbugs.gnu.org
Subject: Re: bug#70816: 29.2; Flymake fails in latex-mode when the buffer is
 narrowed
Date: Sat, 18 May 2024 10:58:05 -0400
Spencer Baugh <sbaugh <at> janestreet.com> writes:
> Can you test with the following patch, please?

Context:

It looks like the latex-mode flymake diagnostic function, tex-chktex,
widens before sending the buffer contents to the external linter
process.  So the line numbers of errors are reported relative to the
widened buffer, not the narrowed buffer.  A number of different checkers
in Emacs seem to do the same thing.

The bug is that these checkers call flymake-diag-region to translate the
line numbers into buffer positions.  But flymake-diag-region does not
widen the buffer when doing this translation, so it fails.

I expect you have some flymake logs of the form "Invalid region line=%s
col=%s". when triggering this bug.

Probably the right fix in flymake is to make flymake-diag-region widen,
as in the patch I posted, but that's a bit of a behavior change...  will
think about it, but it's probably fine.




This bug report was last modified 1 year and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.