diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2013-11-20 v3.1.3
+2014-01-14 v3.1.5
+	* Catching up to GHC 7.7. (@scottgw)
+	* Testing with multi GHC versions. (@eagletmt)
+	* Workaround for the coming new Haskell Platform.
+	* Supporting flymake of the coming Emacs 24.4.
+
+2013-11-20 v3.1.4
 	* GHCi loading as fallback for browse. (@khorser)
 	* Supporting GHC 7.7. (@schell)
 	* Introducing the "-p" and "-q" option for browse. (@mvoidex)
diff --git a/Language/Haskell/GhcMod/CabalApi.hs b/Language/Haskell/GhcMod/CabalApi.hs
--- a/Language/Haskell/GhcMod/CabalApi.hs
+++ b/Language/Haskell/GhcMod/CabalApi.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE OverloadedStrings, CPP #-}
 
 module Language.Haskell.GhcMod.CabalApi (
     getCompilerOptions
@@ -129,7 +129,11 @@
     libBI   = map libBuildInfo       $ maybeToList $ library pd
     execBI  = map buildInfo          $ executables pd
     testBI  = map testBuildInfo      $ testSuites pd
+#if __GLASGOW_HASKELL__ >= 704
     benchBI = map benchmarkBuildInfo $ benchmarks pd
+#else
+    benchBI = []
+#endif
 
 ----------------------------------------------------------------
 
@@ -178,8 +182,11 @@
             Just l -> libModules l
 
     libTargets = map toModuleString $ lib
+#if __GLASGOW_HASKELL__ >= 704
     benchTargets = map toModuleString $ concatMap benchmarkModules $ benchmarks  pd
-
+#else
+    benchTargets = []
+#endif
     toModuleString :: ModuleName -> String
     toModuleString mn = fromFilePath $ toFilePath mn
 
diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs
--- a/Language/Haskell/GhcMod/Gap.hs
+++ b/Language/Haskell/GhcMod/Gap.hs
@@ -45,7 +45,6 @@
 import PprTyThing
 import StringBuffer
 import TcType
-import TcRnTypes
 import CoreSyn
 
 import qualified InstEnv
@@ -53,6 +52,8 @@
 import qualified StringBuffer as SB
 #if __GLASGOW_HASKELL__ >= 707
 import FamInstEnv
+#else
+import TcRnTypes
 #endif
 
 #if __GLASGOW_HASKELL__ >= 706
@@ -68,7 +69,6 @@
 import Pretty
 #endif
 
-
 #if __GLASGOW_HASKELL__ < 706
 import Control.Arrow hiding ((<+>))
 import Data.Convertible
@@ -306,13 +306,7 @@
 deSugar :: TypecheckedModule -> LHsExpr Id -> HscEnv
          -> IO (Maybe CoreSyn.CoreExpr)
 #if __GLASGOW_HASKELL__ >= 707
-deSugar tcm e hs_env = snd <$> deSugarExpr hs_env modu rn_env ty_env fi_env e
-  where
-    modu = ms_mod $ pm_mod_summary $ tm_parsed_module tcm
-    tcgEnv = fst $ tm_internals_ tcm
-    rn_env = tcg_rdr_env tcgEnv
-    ty_env = tcg_type_env tcgEnv
-    fi_env = tcg_fam_inst_env tcgEnv
+deSugar _   e hs_env = snd <$> deSugarExpr hs_env e
 #else
 deSugar tcm e hs_env = snd <$> deSugarExpr hs_env modu rn_env ty_env e
   where
diff --git a/Language/Haskell/GhcMod/Info.hs b/Language/Haskell/GhcMod/Info.hs
--- a/Language/Haskell/GhcMod/Info.hs
+++ b/Language/Haskell/GhcMod/Info.hs
@@ -9,25 +9,25 @@
   , typeOf
   ) where
 
-import Control.Applicative
+import Control.Applicative ((<$>))
 import Control.Monad (void, when)
-import CoreUtils
-import Data.Function
+import CoreUtils (exprType)
+import Data.Function (on)
 import Data.Generics hiding (typeOf)
-import Data.List
-import Data.Maybe
+import Data.List (sortBy)
+import Data.Maybe (catMaybes, fromMaybe, listToMaybe)
 import Data.Ord as O
-import Data.Time.Clock
+import Data.Time.Clock (getCurrentTime)
 import GHC
-import GHC.SYB.Utils
-import HscTypes
-import Language.Haskell.GhcMod.Doc
+import GHC.SYB.Utils (Stage(TypeChecker), everythingStaged)
+import HscTypes (ms_imps)
+import Language.Haskell.GhcMod.Doc (showUnqualifiedPage, showUnqualifiedOneLine, showQualifiedPage)
 import Language.Haskell.GhcMod.GHCApi
-import Language.Haskell.GhcMod.GHCChoice
+import Language.Haskell.GhcMod.GHCChoice ((||>), goNext)
 import qualified Language.Haskell.GhcMod.Gap as Gap
 import Language.Haskell.GhcMod.Gap (HasType(..))
 import Language.Haskell.GhcMod.Types
-import Outputable
+import Outputable (ppr)
 import TcHsSyn (hsPatType)
 
 ----------------------------------------------------------------
diff --git a/elisp/ghc-flymake.el b/elisp/ghc-flymake.el
--- a/elisp/ghc-flymake.el
+++ b/elisp/ghc-flymake.el
@@ -35,17 +35,18 @@
 ;; if they occurred in other files. So, let's cheat flymake.
 (defun ghc-emacs23-larter-hack (tmp-file)
   (let ((real-name (flymake-get-real-file-name tmp-file))
-	(hack-name (flymake-get-real-file-name source-file-name)))
+	(hack-name (flymake-get-real-file-name buffer-file-name)))
     (unless (string= real-name hack-name)
       ;; Change the local variable, line-err-info,
       ;; in flymake-parse-err-lines.
-      (setq line-err-info
-	    (flymake-ler-make-ler
-	     nil
-	     1
-	     (flymake-ler-type line-err-info)
-	     (concat real-name ": " (flymake-ler-text line-err-info))
-	     (flymake-ler-full-file line-err-info))))
+      (when (boundp 'line-err-info)
+	(setq line-err-info
+	      (flymake-ler-make-ler
+	       nil
+	       1
+	       (flymake-ler-type line-err-info)
+	       (concat real-name ": " (flymake-ler-text line-err-info))
+	       (flymake-ler-full-file line-err-info)))))
     hack-name))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -191,9 +192,34 @@
 (defalias 'ghc-flymake-have-errs-p 'ghc-flymake-data)
 
 (defun ghc-flymake-data ()
-  (let* ((line-no (flymake-current-line-no))
+  (let* ((line-no (line-number-at-pos))
          (info (nth 0 (flymake-find-err-info flymake-err-info line-no))))
-    (flymake-make-err-menu-data line-no info)))
+    (flymake-make-err-menu-data-stolen line-no info)))
+
+(defun flymake-make-err-menu-data-stolen (line-no line-err-info-list)
+  "Make a (menu-title (item-title item-action)*) list with errors/warnings from LINE-ERR-INFO-LIST."
+  (let* ((menu-items  nil))
+    (when line-err-info-list
+      (let* ((count           (length line-err-info-list))
+	     (menu-item-text  nil))
+	(while (> count 0)
+	  (setq menu-item-text (flymake-ler-text (nth (1- count) line-err-info-list)))
+	  (let* ((file       (flymake-ler-file (nth (1- count) line-err-info-list)))
+		 (full-file  (flymake-ler-full-file (nth (1- count) line-err-info-list)))
+		 (line       (flymake-ler-line (nth (1- count) line-err-info-list))))
+	    (if file
+		(setq menu-item-text (concat menu-item-text " - " file "(" (format "%d" line) ")")))
+	    (setq menu-items (cons (list menu-item-text
+					 (if file (list 'flymake-goto-file-and-line full-file line) nil))
+				   menu-items)))
+	  (setq count (1- count)))
+	(flymake-log 3 "created menu-items with %d item(s)" (length menu-items))))
+    (if menu-items
+	(let* ((menu-title  (format "Line %d: %d error(s), %d warning(s)" line-no
+				    (flymake-get-line-err-count line-err-info-list "e")
+				    (flymake-get-line-err-count line-err-info-list "w"))))
+	  (list menu-title menu-items))
+      nil)))
 
 (defun ghc-flymake-err-title ()
   (ghc-flymake-err-get-title (ghc-flymake-data)))
diff --git a/elisp/ghc-info.el b/elisp/ghc-info.el
--- a/elisp/ghc-info.el
+++ b/elisp/ghc-info.el
@@ -104,9 +104,12 @@
   (if (= (ghc-type-get-point) (point))
       (ghc-type-set-ix
        (mod (1+ (ghc-type-get-ix)) (length (ghc-type-get-types))))
-    (ghc-type-set-types (ghc-type-obtain-tinfos modname))
-    (ghc-type-set-point (point))
-    (ghc-type-set-ix 0))
+    (let ((types (ghc-type-obtain-tinfos modname)))
+      (if (not (listp types)) ;; main does not exist in Main
+	  (ghc-type-set-types nil)
+	(ghc-type-set-types (ghc-type-obtain-tinfos modname))
+	(ghc-type-set-point (point))
+	(ghc-type-set-ix 0))))
   (ghc-type-get-types))
 
 (defun ghc-type-obtain-tinfos (modname)
diff --git a/ghc-mod.cabal b/ghc-mod.cabal
--- a/ghc-mod.cabal
+++ b/ghc-mod.cabal
@@ -1,5 +1,5 @@
 Name:                   ghc-mod
-Version:                3.1.4
+Version:                3.1.5
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
@@ -62,7 +62,6 @@
                         Language.Haskell.GhcMod.List
                         Language.Haskell.GhcMod.Types
   Build-Depends:        base >= 4.0 && < 5
-                      , Cabal >= 1.10
                       , containers
                       , directory
                       , filepath
@@ -78,6 +77,9 @@
                       , transformers
   if impl(ghc < 7.7)
     Build-Depends:      convertible
+                      , Cabal >= 1.10 && < 1.17
+  else
+    Build-Depends:      Cabal >= 1.18
 
 Executable ghc-mod
   Default-Language:     Haskell2010
@@ -116,7 +118,6 @@
                         LintSpec
                         ListSpec
   Build-Depends:        base >= 4.0 && < 5
-                      , Cabal >= 1.10
                       , containers
                       , directory
                       , filepath
@@ -133,6 +134,9 @@
                       , hspec >= 1.7.1
   if impl(ghc < 7.7)
     Build-Depends:      convertible
+                      , Cabal >= 1.10 && < 1.17
+  else
+    Build-Depends:      Cabal >= 1.18
   if impl(ghc < 7.6.0)
     Build-Depends:      executable-path
 
