From a16bbf55839713e00c0867617152b22adaf0c353 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 7 Oct 2021 18:23:30 -0500 Subject: Figure out flymake-inhibiting after reading local variables --- init.el | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 4eb5e3f..d3b05c8 100644 --- a/init.el +++ b/init.el @@ -547,13 +547,21 @@ specific to most general, they are these: - `flymake-inhibit-major-modes': a list of major-modes in which to inhibit `flymake-mode'. Really only useful if you want to generally add `flymake-mode' to `prog-mode-hook'." - (unless (or (bound-and-true-p flymake-inhibit) ; file-local variable - (list-string-match-p (buffer-name) - flymake-inhibit-buffer-name-regexps) - (list-string-match-p (buffer-file-name) - flymake-inhibit-file-name-regexps) - (apply #'derived-mode-p flymake-inhibit-major-modes)) - (flymake-mode-on))) + ;; The name of this hook tells you pretty much everything you need to know + ;; for this little thing right here. + (add-hook 'hack-local-variables-hook + (defun flymake-unless@hack-local-variables () + (unless (or (cdr (assoc 'flymake-inhibit + file-local-variables-alist)) + (list-string-match-p + (buffer-name) + flymake-inhibit-buffer-name-regexps) + (list-string-match-p + (buffer-file-name) + flymake-inhibit-file-name-regexps) + (apply #'derived-mode-p + flymake-inhibit-major-modes)) + (flymake-mode-on))))) (add-hook 'prog-mode-hook #'flymake-unless) -- cgit 1.4.1-21-gabe81