aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Távora2025-01-17 10:57:46 +0000
committerJoão Távora2025-01-17 10:58:15 +0000
commitf7ff5f1ba4e87596cb4e055492b0e99321fd9950 (patch)
tree067ac45330fcbb4fcb95677f33ce1e40460b7636
parentc9196cf64e60c5c6088725e52d3f387108647e7b (diff)
downloademacs-f7ff5f1ba4e87596cb4e055492b0e99321fd9950.tar.gz
emacs-f7ff5f1ba4e87596cb4e055492b0e99321fd9950.zip
Flymake: fix bug introduced recently
Must protect against flymake--state never having been a hash table at all, so that flymake-mode can be safely turned off even if it never turned on in the first place. Github-reference: https://github.com/joaotavora/eglot/discussions/1480 * lisp/progmodes/flymake.el (flymake-mode): Fix bug.
-rw-r--r--lisp/progmodes/flymake.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index b29d0bc6456..9dda53713f5 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1451,9 +1451,10 @@ special *Flymake log* buffer." :group 'flymake :lighter
1451 (cancel-timer flymake-timer) 1451 (cancel-timer flymake-timer)
1452 (setq flymake-timer nil)) 1452 (setq flymake-timer nil))
1453 (mapc #'flymake--delete-overlay (flymake--really-all-overlays)) 1453 (mapc #'flymake--delete-overlay (flymake--really-all-overlays))
1454 (maphash (lambda (_backend state) 1454 (when flymake--state
1455 (flymake--clear-foreign-diags state)) 1455 (maphash (lambda (_backend state)
1456 flymake--state))) 1456 (flymake--clear-foreign-diags state))
1457 flymake--state))))
1457 ;; turning Flymake on or off has consequences for listings 1458 ;; turning Flymake on or off has consequences for listings
1458 (flymake--update-diagnostics-listings (current-buffer))) 1459 (flymake--update-diagnostics-listings (current-buffer)))
1459 1460