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.
(cherry picked from commit
f7ff5f1ba4e87596cb4e055492b0e99321fd9950)
(cancel-timer flymake-timer)
(setq flymake-timer nil))
(mapc #'flymake--delete-overlay (flymake--really-all-overlays))
- (maphash (lambda (_backend state)
- (flymake--clear-foreign-diags state))
- flymake--state)))
+ (when flymake--state
+ (maphash (lambda (_backend state)
+ (flymake--clear-foreign-diags state))
+ flymake--state))))
;; turning Flymake on or off has consequences for listings
(flymake--update-diagnostics-listings (current-buffer)))