1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-20 18:17:20 +00:00

Don't error when turning on Flymake with no known backends

Leave it to the mode line indicator to inform the user that there
is still some configuration to do.

* lisp/progmodes/flymake.el (flymake-mode): Simplify.
This commit is contained in:
João Távora 2017-10-06 00:07:53 +01:00
parent 03eab7a05e
commit 6b88f78aa1

View File

@ -708,18 +708,14 @@ Interactively, with a prefix arg, FORCE is t."
(cond
;; Turning the mode ON.
(flymake-mode
(cond
((not flymake-diagnostic-functions)
(flymake-error "No backends to check buffer %s" (buffer-name)))
(t
(add-hook 'after-change-functions 'flymake-after-change-function nil t)
(add-hook 'after-save-hook 'flymake-after-save-hook nil t)
(add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
(add-hook 'after-change-functions 'flymake-after-change-function nil t)
(add-hook 'after-save-hook 'flymake-after-save-hook nil t)
(add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
(setq flymake--backend-state (make-hash-table))
(setq flymake--backend-state (make-hash-table))
(when flymake-start-syntax-check-on-find-file
(flymake-start)))))
(when flymake-start-syntax-check-on-find-file
(flymake-start)))
;; Turning the mode OFF.
(t