GNU bug report logs -
#70816
29.2; Flymake fails in latex-mode when the buffer is narrowed
Previous Next
Full log
Message #20 received at 70816 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hi Spencer.
Yes, that does resolve the issue. However, as you hinted, it causes issues
with other diagnostic functions. In my tests, `ess-r-flymake' from the
emacs speaks statistics (ess) package produces incorrect error positions. I
wonder if `flymake-diag-region' should have an optional argument to not
widen the buffer before calculating the positions.
Best,
Vangelis
On Sat, 18 May 2024 at 15:58, Spencer Baugh <sbaugh <at> janestreet.com> wrote:
> 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.
>
[Message part 2 (text/html, inline)]
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.