diff --git a/lisp/init-editorconfig.el b/lisp/init-editorconfig.el index 1ec5ad7..5daf7df 100644 --- a/lisp/init-editorconfig.el +++ b/lisp/init-editorconfig.el @@ -2,15 +2,16 @@ (autoload 'editorconfig-mode "editorconfig" "" t) -(setq creature/editorconfig-timer - (run-with-idle-timer 5 nil #'editorconfig-mode)) - -(add-hook 'find-file-hook #'editorconfig-mode) - -(with-eval-after-load 'editorconfig - (remove-hook 'find-file-hook #'editorconfig-mode) +(defun creature/editorconfig-setup () + (editorconfig-mode 1) + (remove-hook 'find-file-hook #'creature/editorconfig-setup) (cancel-timer creature/editorconfig-timer) (makunbound 'creature/editorconfig-timer)) +(setq creature/editorconfig-timer + (run-with-idle-timer 5 nil #'creature/editorconfig-setup)) + +(add-hook 'find-file-hook #'creature/editorconfig-setup) + (provide 'init-editorconfig)