@@ -59,11 +59,6 @@ If nil, use the Hoogle web-site."
59
59
(const :tag " fp-complete" " https://www.stackage.org/lts/hoogle?q=%s" )
60
60
string))
61
61
62
- (defcustom haskell-hoogle-colorize-with-haskell-mode t
63
- " Whether to use haskell-mode to colorize hoogles's CLI output."
64
- :group 'haskell
65
- :type 'boolean )
66
-
67
62
;;;### autoload
68
63
(defun haskell-hoogle (query &optional info )
69
64
" Do a Hoogle search for QUERY.
@@ -76,24 +71,21 @@ is asked to show extra info for the items matching QUERY.."
76
71
(let* ((command (concat (if (functionp haskell-hoogle-command)
77
72
(funcall haskell-hoogle-command)
78
73
haskell-hoogle-command)
79
- (if info " -i " " " )
80
- " --color " (shell-quote-argument query)))
81
- (output (shell-command-to-string command)))
74
+ (if info " -i " " " )
75
+ " --color " (shell-quote-argument query)))
76
+ (output (shell-command-to-string command)))
82
77
(with-help-window " *hoogle*"
83
78
(with-current-buffer standard-output
84
- (if haskell-hoogle-colorize-with-haskell-mode
85
- (let ((outs (ansi-color-filter-apply output)))
86
- (delay-mode-hooks (haskell-mode ))
87
- (if info
88
- (let ((lns (split-string output " \n " t " " )))
89
- (insert (car lns) " \n\n " )
90
- (dolist (ln (cdr lns)) (insert " -- " ln " \n " )))
91
- (insert outs)
92
- (forward-line -1 )
93
- (when (looking-at-p " ^plus more results" ) (insert " \n -- " )))
94
- (view-mode ))
95
- (insert output)
96
- (ansi-color-apply-on-region (point-min ) (point-max ))))))))
79
+ (let ((outs (ansi-color-filter-apply output)))
80
+ (delay-mode-hooks (haskell-mode ))
81
+ (if info
82
+ (let ((lns (split-string output " \n " t " " )))
83
+ (insert (car lns) " \n\n " )
84
+ (dolist (ln (cdr lns)) (insert " -- " ln " \n " )))
85
+ (insert outs)
86
+ (forward-line -1 )
87
+ (when (looking-at-p " ^plus more results" ) (insert " \n -- " )))
88
+ (view-mode )))))))
97
89
98
90
;;;### autoload
99
91
(defalias 'hoogle 'haskell-hoogle )
@@ -106,9 +98,9 @@ is asked to show extra info for the items matching QUERY.."
106
98
107
99
(defcustom haskell-hoogle-server-command (lambda (port )
108
100
(list " hoogle" " server"
109
- " --local"
110
- " -p"
111
- (number-to-string port)))
101
+ " --local"
102
+ " -p"
103
+ (number-to-string port)))
112
104
" Command used to start the local hoogle server."
113
105
:group 'haskell
114
106
:type 'function
0 commit comments