diff --git a/Check.hs b/Check.hs
--- a/Check.hs
+++ b/Check.hs
@@ -91,4 +91,7 @@
 style = mkUserStyle neverQualify AllTheWay
 
 showSDoc :: SDoc -> String
-showSDoc d = Pretty.showDocWith OneLineMode (d style)
+showSDoc d = map toNull . Pretty.showDocWith ZigZagMode $ d style
+  where
+    toNull '\n' = '\0'
+    toNull x = x
diff --git a/elisp/ghc-command.el b/elisp/ghc-command.el
--- a/elisp/ghc-command.el
+++ b/elisp/ghc-command.el
@@ -17,10 +17,6 @@
     (ghc-insert-module-template))
    ((ghc-flymake-have-errs-p)
     (ghc-flymake-insert-from-warning))
-   ((save-excursion
-      (beginning-of-line)
-      (looking-at "^[^ ]+ *::"))
-    (ghc-insert-function-template))
    (t
     (message "Nothing to be done"))))
 
@@ -28,15 +24,6 @@
   ;; xxx mod from filename...
   (let ((mod (file-name-sans-extension (buffer-name))))
     (insert "module " mod " where\n")))
-
-(defun ghc-insert-function-template ()
-  (save-excursion
-    (beginning-of-line)
-    (when (looking-at "^\\([^ ]+\\) *::")
-      (save-match-data
-	(forward-line)
-	(if (eobp) (insert "\n")))
-      (insert (match-string 1) " = undefined\n"))))
 
 (defun ghc-sort-lines (beg end)
   (interactive "r")
diff --git a/elisp/ghc-comp.el b/elisp/ghc-comp.el
--- a/elisp/ghc-comp.el
+++ b/elisp/ghc-comp.el
@@ -176,11 +176,13 @@
 
 (defun ghc-completion-start-point ()
   (save-excursion
-    (let ((beg (save-excursion (beginning-of-line) (point))))
-      (if (re-search-backward "[ (,`]" beg t) ;; xxx "."
+    (let ((beg (save-excursion (beginning-of-line) (point)))
+	  (regex (save-excursion
+		   (beginning-of-line)
+		   (if (looking-at "^import ") "[ (,`]" "[ (,`.]"))))
+      (if (re-search-backward regex beg t)
 	  (1+ (point))
 	beg))))
-
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
diff --git a/elisp/ghc-flymake.el b/elisp/ghc-flymake.el
--- a/elisp/ghc-flymake.el
+++ b/elisp/ghc-flymake.el
@@ -70,13 +70,7 @@
 (defun ghc-flymake-insert-errors (title errs)
   (save-excursion
     (insert title "\n\n")
-    (mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)
-    (goto-char (point-min))
-    (while (re-search-forward "In the [^:\n ]+: \\|Expected type: \\|Inferred type: \\|Possible fix: " nil t)
-      (replace-match (concat "\n" (match-string 0) "\n    ")))
-    (goto-char (point-max))
-    (while (re-search-backward "In the [a-z]+ argument\\|In the `" nil t)
-      (insert "\n"))))
+    (mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -90,6 +84,13 @@
 	(insert (match-string 1 data)
 		(replace-regexp-in-string "\\[Char\\]" "String" (match-string 3 data))
 		"\n"))
+       ((string-match "lacks an accompanying binding" data)
+	(beginning-of-line)
+	(when (looking-at "^\\([^ ]+\\) *::")
+	  (save-match-data
+	    (forward-line)
+	    (if (eobp) (insert "\n")))
+	  (insert (match-string 1) " = undefined\n")))
        ((string-match "Not in scope: `\\([^']+\\)'" data)
 	(save-match-data
 	  (unless (re-search-forward "^$" nil t)
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:                0.4.2
+Version:                0.4.3
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
