GNU bug report logs - #40573
27.0.90; flymake-mode broken in scratch buffer

Previous Next

Package: emacs;

Reported by: João Távora <joaotavora <at> gmail.com>

Date: Sun, 12 Apr 2020 13:20:02 UTC

Severity: normal

Found in version 27.0.90

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: João Távora <joaotavora <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#40573: closed (27.0.90; flymake-mode broken in scratch buffer)
Date: Fri, 01 May 2020 11:11:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 1 May 2020 12:10:19 +0100
with message-id <CALDnm51A4aUccAN2YJZB_EwMgyZdhkWTqJK_Kcccy=wYOgixzg <at> mail.gmail.com>
and subject line Re: bug#40573: 27.0.90; flymake-mode broken in scratch buffer
has caused the debbugs.gnu.org bug report #40573,
regarding 27.0.90; flymake-mode broken in scratch buffer
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
40573: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40573
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: João Távora <joaotavora <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.90; flymake-mode broken in scratch buffer
Date: Sun, 12 Apr 2020 14:18:50 +0100
[Message part 3 (text/plain, inline)]
Hi,

Eli, remember when you added this commit?

commit 61fb5214816ef3d57e676d900e499ffcd079a1f9
Author: Eli Zaretskii <eliz <at> gnu.org>
Date:   Mon Oct 21 14:29:13 2019 +0300

    Avoid false indications from Flymake in .dir-locals.el files

This seems to have the unintended effect of also disabling flymake-mode
in fileless elisp buffers, like *scratch*.  Was it intended? It seems like
a
regression in relation to 26.3. The repro is simple:

Emacs -Q
M-x flymake-mode

Works in Emacs 26.3, doesn't in Emacs-27.

Again, without wanting to rehash a long and difficult discussion, I
think the best way to fix the original problem is to make an
emacs-lisp-data-mode and use that mode for .dir-locals.el.

  emacs-lisp-data-mode   ; things related to
           ^             ; emacs-lisp-data, like sexp navigation,
           |             ; comments, etc.  Use for .dir-locals.el
           |
           |
     emacs-lisp-mode     ; things related to data which happens
           ^             ; to also be code. Setup xref, flymake, imenu,
           |             ; etc
           |
           |
  lisp-interaction-mode  ; no change, basically this just has an
                         ; enhanced keymap for for the advanced
                         ; interaction possibilities.

That said, whatever fix we can come up with for this regression is
probably safer for Emacs 27.  I propose this slight convolution of the
condition you added.

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2617a6e4cc..f39ecf9b7b 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -264,9 +264,9 @@ emacs-lisp-mode
   (unless
       (let* ((bfname (buffer-file-name))
              (fname (and (stringp bfname) (file-name-nondirectory
bfname))))
-        (or (not (stringp fname))
-            (string-match "\\`\\.#" fname)
-            (string-equal dir-locals-file fname)))
+        (and (stringp fname)
+             (or (string-match "\\`\\.#" fname)
+                 (string-equal dir-locals-file fname))))
     (add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t)
     (add-hook 'flymake-diagnostic-functions
               #'elisp-flymake-byte-compile nil t)))
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, 40573-done <at> debbugs.gnu.org
Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>,
 Dmitry Gutov <dgutov <at> yandex.ru>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#40573: 27.0.90; flymake-mode broken in scratch buffer
Date: Fri, 1 May 2020 12:10:19 +0100
On Mon, Apr 20, 2020 at 5:05 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: João Távora <joaotavora <at> gmail.com>
> > Date: Mon, 20 Apr 2020 15:02:47 +0100
> > Cc: "Basil L. Contovounesios" <contovob <at> tcd.ie>, Stefan Monnier <monnier <at> iro.umontreal.ca>,
> >       Juri Linkov <juri <at> linkov.net>, 40573 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
> >
> > Shall I squash the commits and push to master?
>
> If there's nothing left to take care of, sure.

Done.  Also marking this bug "done".


This bug report was last modified 5 years and 25 days ago.

Previous Next


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