Skip to content

Commit 4206520

Browse files
authored
Remove unnecessary defcustom flag
1 parent 4f8cea6 commit 4206520

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

haskell-hoogle.el

+16-24
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ If nil, use the Hoogle web-site."
5959
(const :tag "fp-complete" "https://www.stackage.org/lts/hoogle?q=%s")
6060
string))
6161

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-
6762
;;;###autoload
6863
(defun haskell-hoogle (query &optional info)
6964
"Do a Hoogle search for QUERY.
@@ -76,24 +71,21 @@ is asked to show extra info for the items matching QUERY.."
7671
(let* ((command (concat (if (functionp haskell-hoogle-command)
7772
(funcall haskell-hoogle-command)
7873
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)))
8277
(with-help-window "*hoogle*"
8378
(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)))))))
9789

9890
;;;###autoload
9991
(defalias 'hoogle 'haskell-hoogle)
@@ -106,9 +98,9 @@ is asked to show extra info for the items matching QUERY.."
10698

10799
(defcustom haskell-hoogle-server-command (lambda (port)
108100
(list "hoogle" "server"
109-
"--local"
110-
"-p"
111-
(number-to-string port)))
101+
"--local"
102+
"-p"
103+
(number-to-string port)))
112104
"Command used to start the local hoogle server."
113105
:group 'haskell
114106
:type 'function

0 commit comments

Comments
 (0)