unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vangelis Evangelou <evangelou@gmail.com>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: Arash Esbati <arash@gnu.org>, 70816@debbugs.gnu.org
Subject: bug#70816: 29.2; Flymake fails in latex-mode when the buffer is narrowed
Date: Sat, 18 May 2024 18:11:58 +0100	[thread overview]
Message-ID: <CAD1AF2fZCb9xjFXi1JR1cLjbhitYHCpxWf+m7N8=1cQ3QMu3AA@mail.gmail.com> (raw)
In-Reply-To: <iery1879ngi.fsf@janestreet.com>

[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]

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@janestreet.com> wrote:

> Spencer Baugh <sbaugh@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.
>

[-- Attachment #2: Type: text/html, Size: 1928 bytes --]

      reply	other threads:[~2024-05-18 17:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07  7:56 bug#70816: 29.2; Flymake fails in latex-mode when the buffer is narrowed Vangelis Evangelou
2024-05-07 15:19 ` Arash Esbati
2024-05-18  8:41   ` Eli Zaretskii
2024-05-18 14:51   ` Spencer Baugh
2024-05-18 14:58     ` Spencer Baugh
2024-05-18 17:11       ` Vangelis Evangelou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD1AF2fZCb9xjFXi1JR1cLjbhitYHCpxWf+m7N8=1cQ3QMu3AA@mail.gmail.com' \
    --to=evangelou@gmail.com \
    --cc=70816@debbugs.gnu.org \
    --cc=arash@gnu.org \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).