[Haskell-cafe] Why do I see the escape chars in Emacs with haskell-mode

Alan & Kim Zimmerman alan.zimm at gmail.com
Sat Jul 30 19:04:47 UTC 2022


Sort-of related, I have this setting to honour the escape sequences in my
*compile* buffer

```
;;----------------------------------------------------------------------
;; Enable ansi colours in the compile buffer.
;; See
https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer#3072831
(ignore-errors
  (require 'ansi-color)
  (defun my-colorize-compilation-buffer ()
    (when (eq major-mode 'compilation-mode)
      (ansi-color-apply-on-region compilation-filter-start (point-max))))
  (add-hook 'compilation-filter-hook 'my-colorize-compilation-buffer))
```

On Sat, 30 Jul 2022 at 19:54, Henry Laxen <nadine.and.henry at pobox.com>
wrote:

> Dear Cafe,
>
> Greeting Gentle Haskellers,
>
> I know this may really be a question for the emacs guys, but I thought
> for sure someone here has encoutered the same thing and would
> recognize the problem right away.
>
> Here is my progam:
>
> module Main where
> main = xprint "hi"
>
> Yes, xprint is intensional, I want an error.
>
> I am in haskell mode in emacs.  I type C-c C-l running
> haskell-process-load-file, and get:
>
> Hours of hacking await!
> If I break, you can:
>   1. Restart:           M-x haskell-process-restart
>   2. Configure logging: C-h v haskell-process-log (useful for debugging)
>   3. General config:    M-x customize-mode
>   4. Hide these tips:   C-h v haskell-process-show-debug-tips
> .[;1m/home/henry/a.hs:2:8-13: .[;1m.[31merror:.[0m.[0m.[;1m.[0m.[0m.[;1m …
>     • Variable not in scope: xprint :: [Char] -> t
>     • Perhaps you meant ‘print’ (imported from Prelude).[0m.[0m
> .[;1m/home/henry/a.hs:2:8-13: .[;1m.[31merror:.[0m.[0m.[;1m.[0m.[0m.[;1m …
>     • Variable not in scope: xprint :: [Char] -> t
>     • Perhaps you meant ‘print’ (imported from Prelude).[0m.[0m
> Compilation failed.
>
> but when I swich to the *haskell* buffer and type :r, I get the
> beautiful, colorized message:
>
> [1 of 1] Compiling Main             ( /home/henry/a.hs, interpreted )
>
> /home/henry/a.hs:2:8-13: error:
>     • Variable not in scope: xprint :: [Char] -> t
>     • Perhaps you meant ‘print’ (imported from Prelude)
>   |
> 2 | main = xprint "hi"
>   |        ^^^^^^
> Failed, no modules loaded.
>
> Where the escape sequences have been interpreted correctly.  What do I
> have misconfigured?  Please point me in a direction.  Thanks in
> advance.
>
> Best wishes,
> Henry Laxen
>
> --
> Nadine and Henry Laxen            The rest is silence
> Gral. Manuel Márquez de León 1301
> Onix #2302
> Zona Urban Rio                    Never try to teach a pig to sing;
> Tijuana                           It wastes your time
> +52 (333) 667-8633                And it annoys the pig
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20220730/de59f898/attachment.html>


More information about the Haskell-Cafe mailing list