removing the last null charactors.

WARNING: prabably breaking backward compatibility.
This commit is contained in:
Kazu Yamamoto 2014-03-26 11:32:54 +09:00
parent 324f9093a0
commit 102ae7654b
2 changed files with 2 additions and 8 deletions

View File

@ -76,7 +76,7 @@ ppErrMsg dflag ls err = ppMsg spn SevError dflag ls msg ++ ext
ext = showMsg dflag ls (errMsgExtraInfo err) ext = showMsg dflag ls (errMsgExtraInfo err)
ppMsg :: SrcSpan -> Severity-> DynFlags -> LineSeparator -> SDoc -> String ppMsg :: SrcSpan -> Severity-> DynFlags -> LineSeparator -> SDoc -> String
ppMsg spn sev dflag ls@(LineSeparator lsep) msg = prefix ++ cts ++ lsep ppMsg spn sev dflag ls@(LineSeparator lsep) msg = prefix ++ cts -- ++ lsep
where where
cts = showMsg dflag ls msg cts = showMsg dflag ls msg
defaultPrefix defaultPrefix
@ -91,12 +91,6 @@ ppMsg spn sev dflag ls@(LineSeparator lsep) msg = prefix ++ cts ++ lsep
---------------------------------------------------------------- ----------------------------------------------------------------
showMsg :: DynFlags -> LineSeparator -> SDoc -> String showMsg :: DynFlags -> LineSeparator -> SDoc -> String
showMsg dflag (LineSeparator [s]) sdoc = replaceNull $ showUnqualifiedPage dflag sdoc
where
replaceNull :: String -> String
replaceNull [] = []
replaceNull ('\n':xs) = s : replaceNull xs
replaceNull (x:xs) = x : replaceNull xs
showMsg dflag (LineSeparator lsep) sdoc = replaceNull $ showUnqualifiedPage dflag sdoc showMsg dflag (LineSeparator lsep) sdoc = replaceNull $ showUnqualifiedPage dflag sdoc
where where
replaceNull [] = [] replaceNull [] = []

View File

@ -133,7 +133,7 @@
nil nil
(lambda () (lambda ()
(insert (overlay-get (car ovls) 'ghc-file) "\n\n") (insert (overlay-get (car ovls) 'ghc-file) "\n\n")
(mapc (lambda (x) (insert x "\n")) errs)))))) (mapc (lambda (x) (insert x "\n\n")) errs))))))
(defun ghc-check-overlay-at (p) (defun ghc-check-overlay-at (p)
(let ((ovls (overlays-at p))) (let ((ovls (overlays-at p)))