unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40573: 27.0.90; flymake-mode broken in scratch buffer
@ 2020-04-12 13:18 João Távora
  2020-04-12 13:48 ` Eli Zaretskii
  0 siblings, 1 reply; 64+ messages in thread
From: João Távora @ 2020-04-12 13:18 UTC (permalink / raw)
  To: 40573

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

Hi,

Eli, remember when you added this commit?

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

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

^ permalink raw reply related	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2020-05-01 11:10 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-12 13:18 bug#40573: 27.0.90; flymake-mode broken in scratch buffer João Távora
2020-04-12 13:48 ` Eli Zaretskii
2020-04-12 14:24   ` João Távora
2020-04-12 14:44     ` Eli Zaretskii
2020-04-12 17:02       ` João Távora
2020-04-12 17:17         ` Eli Zaretskii
2020-04-12 17:50           ` João Távora
2020-04-12 23:58         ` Juri Linkov
2020-04-13  4:36           ` Eli Zaretskii
2020-04-13 23:17             ` Juri Linkov
2020-04-14  5:51               ` Eli Zaretskii
2020-04-14  8:48                 ` João Távora
2020-04-14 11:29                   ` Eli Zaretskii
2020-04-14 11:48                     ` João Távora
2020-04-14 12:38                       ` Eli Zaretskii
2020-04-14 12:56                         ` João Távora
2020-04-14 15:42                           ` Eli Zaretskii
2020-04-14 16:42                             ` João Távora
2020-04-14 20:05                               ` Stefan Monnier
2020-04-16 21:43                 ` Juri Linkov
2020-04-16 23:06                   ` Stefan Monnier
2020-04-17  6:49                     ` Eli Zaretskii
2020-04-17 10:07                       ` João Távora
2020-04-17 10:12                         ` Eli Zaretskii
2020-04-17 10:21                           ` João Távora
2020-04-17 11:49                             ` Eli Zaretskii
2020-04-17 11:57                               ` João Távora
2020-04-17 13:05                                 ` Eli Zaretskii
2020-04-17 15:20                                   ` João Távora
2020-04-17 15:28                                     ` Eli Zaretskii
2020-04-17 15:35                                       ` João Távora
2020-04-17 15:46                                         ` Eli Zaretskii
2020-04-17 15:55                                           ` João Távora
2020-04-17 17:19                                             ` Eli Zaretskii
2020-04-18  8:26                                               ` João Távora
2020-04-18  9:28                                                 ` Eli Zaretskii
2020-04-18 10:03                                                   ` João Távora
2020-04-18 11:08                                                     ` Eli Zaretskii
2020-04-18 11:57                                                       ` João Távora
2020-04-18 12:35                                                         ` Eli Zaretskii
2020-04-18 15:10                                                           ` João Távora
2020-04-18 23:36                                                             ` João Távora
2020-04-19  0:05                                                               ` Dmitry Gutov
2020-04-19  9:25                                                                 ` João Távora
2020-04-19 13:57                                                                   ` Dmitry Gutov
2020-04-19 16:31                                                                     ` João Távora
2020-04-19 16:38                                                                       ` Dmitry Gutov
2020-04-19  2:44                                                               ` Stefan Monnier
2020-04-19 14:01                                                               ` Eli Zaretskii
2020-04-19 20:17                                                                 ` João Távora
2020-04-20 13:41                                                                   ` Eli Zaretskii
2020-04-20 14:02                                                                     ` João Távora
2020-04-20 16:05                                                                       ` Eli Zaretskii
2020-05-01 11:10                                                                         ` João Távora
2020-04-18 11:55                                                     ` Basil L. Contovounesios
2020-04-18 12:03                                                       ` João Távora
2020-04-19  0:20                                                         ` Basil L. Contovounesios
2020-04-19 11:41                                                           ` João Távora
2020-04-18 23:42                                                 ` Juri Linkov
2020-04-19  9:16                                                   ` João Távora
2020-04-17 14:44                               ` Basil L. Contovounesios
2020-04-17 16:04                                 ` Stefan Monnier
2020-04-17  6:23                   ` Eli Zaretskii
2020-04-18 23:36                     ` Juri Linkov

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).