Skip to content

Commit

Permalink
Make dummy global binding to avoid not-in-scope warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdone committed Jan 16, 2014
1 parent ed4d9e8 commit f44c2d3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
(require 'haskell-str)
(require 'haskell-utils)
(require 'haskell-presentation-mode)
(require 'haskell-navigate-imports)
(with-no-warnings (require 'cl))

;; FIXME: haskell-process shouldn't depend on haskell-interactive-mode to avoid module-dep cycles
Expand Down Expand Up @@ -181,6 +182,7 @@ imports become available?"
:type 'boolean
:group 'haskell-interactive)

(defvar haskell-imported-suggested nil)
(defvar haskell-process-prompt-regex "\\(^[> ]*> $\\|\n[> ]*> $\\)")
(defvar haskell-reload-p nil)

Expand Down Expand Up @@ -467,7 +469,8 @@ to be loaded by ghci."
(let* ((process (cadr state))
(session (haskell-process-session process))
(message-count 0)
(cursor (haskell-process-response-cursor process)))
(cursor (haskell-process-response-cursor process))
(haskell-imported-suggested (list)))
(haskell-process-set-response-cursor process 0)
(while (haskell-process-errors-warnings session process response)
(setq message-count (1+ message-count)))
Expand Down Expand Up @@ -522,7 +525,7 @@ actual Emacs buffer of the module being loaded."
((haskell-process-consume process "Failed, modules loaded: \\(.+\\)\\.$")
(let* ((modules (haskell-process-extract-modules buffer))
(cursor (haskell-process-response-cursor process))
(imported-suggested (list)))
(haskell-imported-suggested (list)))
(haskell-process-set-response-cursor process 0)
(while (haskell-process-errors-warnings session process buffer))
(haskell-process-set-response-cursor process cursor)
Expand Down Expand Up @@ -675,13 +678,13 @@ now."
(let* ((ident (match-string 1 msg))
(module (haskell-process-hoogle-ident ident)))
(when module
(unless (member module imported-suggested)
(unless (member module haskell-imported-suggested)
(when (y-or-n-p
(format
"Identifier `%s' not in scope, import `%s'?"
ident
module))
(push module imported-suggested)
(push module haskell-imported-suggested)
(haskell-process-find-file session file)
(save-excursion
(haskell-navigate-imports)
Expand Down

0 comments on commit f44c2d3

Please sign in to comment.