From b6b40bb4abad3b4ca704f50c108781db81110573 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Thu, 7 Aug 2014 11:38:20 -0700 Subject: [PATCH] feat(emacs): use optional package when required --- src/emacs/lean-flycheck.el | 2 ++ src/emacs/lean-mode.el | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/emacs/lean-flycheck.el b/src/emacs/lean-flycheck.el index 8fc4a2ced..591e7a8d7 100644 --- a/src/emacs/lean-flycheck.el +++ b/src/emacs/lean-flycheck.el @@ -4,6 +4,8 @@ ;; Author: Soonho Kong ;; +(require 'flycheck) + (setq-local lean-lmake-name "lmake") (setq-local lean-lmake-options "--flycheck") (eval diff --git a/src/emacs/lean-mode.el b/src/emacs/lean-mode.el index ca584cf5c..f70b9d07e 100644 --- a/src/emacs/lean-mode.el +++ b/src/emacs/lean-mode.el @@ -8,9 +8,6 @@ (require 'generic-x) (require 'compile) (require 'flymake) -(require 'flycheck) -(require 'fill-column-indicator) -(require 'whitespace-cleanup-mode) (require 'lean-util) (require 'lean-settings) (require 'lean-flycheck) @@ -84,10 +81,12 @@ (when (and lean-rule-column lean-show-rule-column-method) (cl-case lean-show-rule-column-method - ('vline (setq fci-rule-column lean-rule-column) + ('vline (require 'fill-column-indicator) + (setq fci-rule-column lean-rule-column) (add-hook 'lean-mode-hook 'fci-mode)))) (if lean-delete-trailing-whitespace - (add-hook 'lean-mode-hook 'whitespace-cleanup-mode) + (progn (require 'whitespace-cleanup-mode) + (add-hook 'lean-mode-hook 'whitespace-cleanup-mode)) (remove-hook 'lean-mode-hook 'whitespace-cleanup-mode)) )) "A mode for Lean files" ;; doc string for this mode