Skip to content

Commit 4e9e538

Browse files
Fixed typo and moved suggested-already.
1 parent feeb964 commit 4e9e538

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

haskell-process.el

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -873,9 +873,11 @@ from `module-buffer'."
873873
cabal-file))
874874
(haskell-cabal-add-dependency package-name version nil t))))
875875

876-
(defun haskell-process-suggest-imports (imports ident)
877-
"Given a list of IMPORTS, suggest adding them to the import section."
878-
(let ((module (cond ((> (length modules) 1)
876+
(defun haskell-process-suggest-imports (modules ident)
877+
"Given a list of MODULES, suggest adding them to the import section."
878+
(let ((process (haskell-session-process session))
879+
(suggested-already (haskell-process-suggested-imports process))
880+
(module (cond ((> (length modules) 1)
879881
(when (y-or-n-p (format "Identifier `%s' not in scope, choose module to import?"
880882
ident))
881883
(haskell-complete-module-read "Module: " modules)))
@@ -901,9 +903,7 @@ from `module-buffer'."
901903
"Given an out of scope identifier, Hoogle for that identifier,
902904
and if a result comes back, suggest to import that identifier
903905
now."
904-
(let* ((process (haskell-session-process session))
905-
(suggested-already (haskell-process-suggested-imports process))
906-
(ident (let ((i (match-string 1 msg)))
906+
(let* ((ident (let ((i (match-string 1 msg)))
907907
;; Skip qualification.
908908
(if (string-match "^[A-Za-z0-9_'.]+\\.\\(.+\\)$" i)
909909
(match-string 1 i)
@@ -915,9 +915,7 @@ now."
915915
"Given an out of scope identifier, Hayoo for that identifier,
916916
and if a result comes back, suggest to import that identifier
917917
now."
918-
(let* ((process (haskell-session-process session))
919-
(suggested-already (haskell-process-suggested-imports process))
920-
(ident (let ((i (match-string 1 msg)))
918+
(let* ((ident (let ((i (match-string 1 msg)))
921919
;; Skip qualification.
922920
(if (string-match "^[A-Za-z0-9_'.]+\\.\\(.+\\)$" i)
923921
(match-string 1 i)

0 commit comments

Comments
 (0)