emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40573: closed (27.0.90; flymake-mode broken in scratch buffer)


From: GNU bug Tracking System
Subject: bug#40573: closed (27.0.90; flymake-mode broken in scratch buffer)
Date: Fri, 01 May 2020 11:11:02 +0000

Your message dated Fri, 1 May 2020 12:10:19 +0100
with message-id <CALDnm51A4aUccAN2YJZB_EwMgyZdhkWTqJK_Kcccy=address@hidden>
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
address@hidden.)


-- 
40573: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40573
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 27.0.90; flymake-mode broken in scratch buffer Date: Sun, 12 Apr 2020 14:18:50 +0100
Hi,

Eli, remember when you added this commit?

commit 61fb5214816ef3d57e676d900e499ffcd079a1f9
Author: Eli Zaretskii <address@hidden>
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)))

--- End Message ---
--- Begin Message --- 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 <address@hidden> wrote:
>
> > From: João Távora <address@hidden>
> > Date: Mon, 20 Apr 2020 15:02:47 +0100
> > Cc: "Basil L. Contovounesios" <address@hidden>, Stefan Monnier 
> > <address@hidden>,
> >       Juri Linkov <address@hidden>, address@hidden, Dmitry Gutov 
> > <address@hidden>
> >
> > 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".


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]