Skip to content

Commit 70cdab6

Browse files
committed
Merge pull request #573 from gracjan/pr-fix-haskell-docs
Fix haskell-docs invocation.
2 parents abab271 + 60ebe6a commit 70cdab6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

haskell-commands.el

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,18 @@ PROCESS."
198198

199199
(defun haskell-process-haskell-docs-ident (ident)
200200
"Search with haskell-docs for IDENT, returns a list of modules."
201-
(cl-remove-if-not (lambda (a) (string-match "^[A-Z][A-Za-b0-9_'.]+$" a))
202-
(split-string (shell-command-to-string (concat "haskell-docs --modules " ident))
203-
"\n")))
201+
(cl-remove-if-not
202+
(lambda (a) (string-match "^[[:upper:]][[:alnum:]_'.]+$" a))
203+
(split-string
204+
(with-output-to-string
205+
(with-current-buffer
206+
standard-output
207+
(call-process "haskell-docs"
208+
nil ; no infile
209+
t ; output to current buffer (that is string)
210+
nil ; do not redisplay
211+
"--modules" ident)))
212+
"\n")))
204213

205214
(defun haskell-process-import-modules (process modules)
206215
"Import `modules' with :m +, and send any import statements

0 commit comments

Comments
 (0)