From 60ebe6a5fbe85df5dd0426847b45884454035d76 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Tue, 7 Apr 2015 21:36:30 +0200 Subject: [PATCH] Fix haskell-docs invocation. --- haskell-commands.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/haskell-commands.el b/haskell-commands.el index d2dcb9638..eb5a9b050 100644 --- a/haskell-commands.el +++ b/haskell-commands.el @@ -198,9 +198,18 @@ PROCESS." (defun haskell-process-haskell-docs-ident (ident) "Search with haskell-docs for IDENT, returns a list of modules." - (cl-remove-if-not (lambda (a) (string-match "^[A-Z][A-Za-b0-9_'.]+$" a)) - (split-string (shell-command-to-string (concat "haskell-docs --modules " ident)) - "\n"))) + (cl-remove-if-not + (lambda (a) (string-match "^[[:upper:]][[:alnum:]_'.]+$" a)) + (split-string + (with-output-to-string + (with-current-buffer + standard-output + (call-process "haskell-docs" + nil ; no infile + t ; output to current buffer (that is string) + nil ; do not redisplay + "--modules" ident))) + "\n"))) (defun haskell-process-import-modules (process modules) "Import `modules' with :m +, and send any import statements