diff --git a/init.el b/init.el index 1fc4596..32dac21 100644 --- a/init.el +++ b/init.el @@ -593,6 +593,7 @@ db/text-to-hex conditionally-enable-lispy turn-on-lispy-when-available + turn-on-flycheck-when-file db/sort-nsm-permanent-settings endless/colorize-compilation db/turn-off-local-electric-pair-mode @@ -2587,7 +2588,7 @@ With given ARG, display files in `db/important-document-path’." (use-package elisp-mode :config (progn (add-hook 'emacs-lisp-mode-hook 'turn-on-lispy-when-available) - (add-hook 'emacs-lisp-mode-hook 'flycheck-mode))) + (add-hook 'emacs-lisp-mode-hook 'turn-on-flycheck-when-file))) (use-package geiser :commands (geiser-mode)) diff --git a/site-lisp/db-utils.el b/site-lisp/db-utils.el index 58d6bf2..099c006 100644 --- a/site-lisp/db-utils.el +++ b/site-lisp/db-utils.el @@ -257,6 +257,11 @@ Will print a warning in case of failure." (require 'lispy) (lispy-mode))) +(defun turn-on-flycheck-when-file () + "Turn on `flycheck-mode' when buffer is associated with a file." + (when buffer-file-name + (flycheck-mode +1))) + (defun db/sort-nsm-permanent-settings () "Sort values in `nsm-permanent-host-settings’." (setq nsm-permanent-host-settings