[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect
From: |
Juri Linkov |
Subject: |
bug#34294: 27.0.50; flymake-start-on-save-buffer has no effect |
Date: |
Wed, 27 Mar 2019 23:38:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
Hi João,
>> It looks good to me. I just have a suggestion and would like
>> to see the commit msg, too.
>
> Please see the patch with the commit msg attached.
Could you please also push an additional patch that fixes
a race condition in flymake. The problem is that currently
flymake starts even when flymake-mode is disabled.
Having such customization in ~/.emacs to not enable flymake-mode
in read-only buffers:
(add-hook 'ruby-mode-hook
(lambda ()
(flymake-mode 1)
(add-hook 'view-mode-hook
(lambda ()
(flymake-mode (if view-mode -1 1)))
nil t)))
It still runs flymake in read-only buffers because it disregards
the fact that flymake-mode becomes disabled before starting
flymake from post-command-hook or window-configuration-change-hook.
The fix is to check for flymake-mode again after hooks are finished:
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index d6cd370dac..1c7823cb85 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -900,7 +904,7 @@ flymake-start
(add-hook 'window-configuration-change-hook
#'start-on-display
'append 'local))
- (t
+ (flymake-mode
(setq flymake-check-start-time (float-time))
(let ((backend-args
(and