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 #14 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:51:35 -0400
Can you test with the following patch, please?

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index ef190ff0cb5..146aae06253 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -430,6 +430,8 @@ flymake-diag-region
         (let ((line (min (max line 1)
                          (line-number-at-pos (point-max) 'absolute))))
           (save-excursion
+            (save-restriction
+              (widen)
             (save-match-data
               (goto-char (point-min))
               (forward-line (1- line))
@@ -463,7 +465,7 @@ flymake-diag-region
                               (fallback-eol beg))))
                   (let* ((beg (fallback-bol))
                          (end (fallback-eol beg)))
-                    (cons beg end))))))))
+                    (cons beg end)))))))))
     (error (flymake-log :warning "Invalid region line=%s col=%s" line col)
            nil)))
 




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

Previous Next


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