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.
This commit is contained in:
parent
0e2662dc3c
commit
e1d2cbd1c4
|
@ -162,25 +162,25 @@
|
||||||
[?\C-c ?\C-z] 'haskell-interactive-switch))))
|
[?\C-c ?\C-z] 'haskell-interactive-switch))))
|
||||||
|
|
||||||
(eval-after-load 'haskell-indentation
|
(eval-after-load 'haskell-indentation
|
||||||
(progn
|
'(progn
|
||||||
;; Show indentation guides in insert or emacs state only.
|
;; Show indentation guides in insert or emacs state only.
|
||||||
(defun spacemacs//haskell-indentation-show-guides ()
|
(defun spacemacs//haskell-indentation-show-guides ()
|
||||||
"Show visual indentation guides."
|
"Show visual indentation guides."
|
||||||
(when (derived-mode-p 'haskell-mode)
|
(when (and (boundp 'haskell-indentation-mode) haskell-indentation-mode)
|
||||||
(haskell-indentation-enable-show-indentations)))
|
(haskell-indentation-enable-show-indentations)))
|
||||||
|
|
||||||
(defun spacemacs//haskell-indentation-hide-guides ()
|
(defun spacemacs//haskell-indentation-hide-guides ()
|
||||||
"Hide visual indentation guides."
|
"Hide visual indentation guides."
|
||||||
(when (derived-mode-p 'haskell-mode)
|
(when (and (boundp 'haskell-indentation-mode) haskell-indentation-mode)
|
||||||
(haskell-indentation-disable-show-indentations)))
|
(haskell-indentation-disable-show-indentations)))
|
||||||
|
|
||||||
;; first entry in normal state
|
;; first entry in normal state
|
||||||
(add-hook 'evil-normal-state-entry-hook 'spacemacs//haskell-indentation-hide-guides)
|
(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-insert-state-entry-hook 'spacemacs//haskell-indentation-show-guides)
|
||||||
(add-hook 'evil-emacs-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-insert-state-exit-hook 'spacemacs//haskell-indentation-hide-guides)
|
||||||
(add-hook 'evil-emacs-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 ()
|
(defun haskell/init-haskell-snippets ()
|
||||||
;; manually load the package since the current implementation is not lazy
|
;; manually load the package since the current implementation is not lazy
|
||||||
|
|
Loading…
Reference in a new issue