From e1d2cbd1c4c2c718c142b93ed4f27c658c56bb5d Mon Sep 17 00:00:00 2001 From: Chris Barrett Date: Tue, 5 May 2015 09:17:02 +1200 Subject: [PATCH] haskell: fix haskell-indentation eval-after-load The `progn` in the eval-after-load was not quoted, so it was being evaluated unconditionally. This led to the haskell-indentation guides being unconditionally enabled. Additionally, only enable the indentation guides when haskell-indentation-mode is on. Resolves #1136. --- contrib/lang/haskell/packages.el | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/lang/haskell/packages.el b/contrib/lang/haskell/packages.el index ade51ac16..5b48c7854 100644 --- a/contrib/lang/haskell/packages.el +++ b/contrib/lang/haskell/packages.el @@ -162,25 +162,25 @@ [?\C-c ?\C-z] 'haskell-interactive-switch)))) (eval-after-load 'haskell-indentation - (progn - ;; Show indentation guides in insert or emacs state only. - (defun spacemacs//haskell-indentation-show-guides () - "Show visual indentation guides." - (when (derived-mode-p 'haskell-mode) - (haskell-indentation-enable-show-indentations))) + '(progn + ;; Show indentation guides in insert or emacs state only. + (defun spacemacs//haskell-indentation-show-guides () + "Show visual indentation guides." + (when (and (boundp 'haskell-indentation-mode) haskell-indentation-mode) + (haskell-indentation-enable-show-indentations))) - (defun spacemacs//haskell-indentation-hide-guides () - "Hide visual indentation guides." - (when (derived-mode-p 'haskell-mode) - (haskell-indentation-disable-show-indentations))) + (defun spacemacs//haskell-indentation-hide-guides () + "Hide visual indentation guides." + (when (and (boundp 'haskell-indentation-mode) haskell-indentation-mode) + (haskell-indentation-disable-show-indentations))) - ;; first entry in normal state - (add-hook 'evil-normal-state-entry-hook 'spacemacs//haskell-indentation-hide-guides) + ;; first entry in normal state + (add-hook 'evil-normal-state-entry-hook 'spacemacs//haskell-indentation-hide-guides) - (add-hook 'evil-insert-state-entry-hook 'spacemacs//haskell-indentation-show-guides) - (add-hook 'evil-emacs-state-entry-hook 'spacemacs//haskell-indentation-show-guides) - (add-hook 'evil-insert-state-exit-hook 'spacemacs//haskell-indentation-hide-guides) - (add-hook 'evil-emacs-state-exit-hook 'spacemacs//haskell-indentation-hide-guides)))) + (add-hook 'evil-insert-state-entry-hook 'spacemacs//haskell-indentation-show-guides) + (add-hook 'evil-emacs-state-entry-hook 'spacemacs//haskell-indentation-show-guides) + (add-hook 'evil-insert-state-exit-hook 'spacemacs//haskell-indentation-hide-guides) + (add-hook 'evil-emacs-state-exit-hook 'spacemacs//haskell-indentation-hide-guides)))) (defun haskell/init-haskell-snippets () ;; manually load the package since the current implementation is not lazy