summaryrefslogtreecommitdiffhomepage
path: root/init.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-18 02:38:21 +0100
committerjao <jao@gnu.org>2022-09-18 02:44:43 +0100
commit9c89468662b2efad093a48b5c8a45e47603b4b4f (patch)
treeff825f6ac6f221e616f89f1752ca006c0788358f /init.el
parent4b44498cb7943167a774c4a64d2dfd04c0ce81e1 (diff)
downloadelibs-9c89468662b2efad093a48b5c8a45e47603b4b4f.tar.gz
elibs-9c89468662b2efad093a48b5c8a45e47603b4b4f.tar.bz2
a couple of haskell tweaks
Diffstat (limited to 'init.el')
-rw-r--r--init.el30
1 files changed, 19 insertions, 11 deletions
diff --git a/init.el b/init.el
index bec7615..c930215 100644
--- a/init.el
+++ b/init.el
@@ -2092,7 +2092,6 @@
(use-package flymake
:ensure t
:custom ((flymake-mode-line-format '(" " flymake-mode-line-counters)))
- :hook ((haskell-mode . flymake-mode))
:config (jao-define-attached-buffer "^\\*Flymake diagnostics .*\\*\\'")
:bind (:map flymake-mode-map (("s-f n" . flymake-goto-next-error)
("s-f p" . flymake-goto-prev-error)
@@ -2361,7 +2360,9 @@
:custom
((inferior-haskell-find-project-root t)
(haskell-check-remember-last-command-p nil)
+ (haskell-completing-read-function 'completing-read)
(haskell-font-lock-symbols nil)
+ (haskell-hoogle-command "hoogle")
(haskell-interactive-popup-errors nil)
(haskell-process-auto-import-loaded-modules t)
(haskell-process-log t)
@@ -2372,9 +2373,9 @@
(haskell-stylish-on-save nil))
:config
- (defun jao-haskell-hoogle (query)
- (interactive (hoogle-prompt))
- (haskell-hoogle query t))
+ (defun jao-haskell-hoogle (no-info)
+ (interactive "P")
+ (haskell-hoogle (format "%s" (haskell-ident-at-point)) (not no-info)))
(put 'haskell-process-args-cabal-repl
'safe-local-variable
@@ -2385,13 +2386,18 @@
haskell-doc-mode
haskell-decl-scan-mode
haskell-indentation-mode
- haskell-auto-insert-module-template))
+ flymake-mode
+ (lambda () (eldoc-mode -1))))
(add-hook 'haskell-mode-hook h))
+ (add-hook 'haskell-presentation-mode-hook (lambda () (whitespace-mode -1)))
+
:bind (:map haskell-mode-map
(("C-c C-d" . jao-haskell-hoogle)
- ("C-c h" . haskell-hoogle-lookup-from-local)
- ("C-c C-c" . haskell-compile))))
+ ("C-c h" . haskell-hoogle)
+ ("C-c C-c" . haskell-compile)
+ ("C-c C-e" . haskell-command-insert-language-pragma)
+ ("<f3>" . haskell-session-kill))))
(require 'haskell)
@@ -2400,6 +2406,8 @@
(diminish haskell-decl-scan-mode)
(jao-define-attached-buffer "\\*hoogle\\*.*")
+(jao-define-attached-buffer '(major-mode . haskell-interactive-mode) 0.33)
+(jao-define-attached-buffer '(major-mode . haskell-presentation-mode) 0.25)
;; needs cabal install apply-refact
(use-package hlint-refactor
@@ -2416,11 +2424,11 @@
("is" "Sort imports" haskell-sort-imports)
("ia" "Align imports" haskell-align-imports)]
["Code"
- ("c" "Compile" haskell-compile)
- ("s" "stylish on buffer" haskell-mode-stylish-buffer)]
- ["Hoogle"
+ ("c" "haskell check (hlint)" haskell-check)
+ ("l" "insert language pragma" haskell-command-insert-language-pragma)]
+ ["Help"
("h" "Hoogle" jao-haskell-hoogle)
- ("H" "Hoogle from local server" haskell-hoogle-lookup-from-local)])
+ ("TAB" "show info" haskell-process-do-info)])
;;;; Pie
(jao-load-path "pie")