help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs CVS and inferior-haskell process


From: Ashish SHUKLA
Subject: Emacs CVS and inferior-haskell process
Date: Sun, 01 Feb 2009 13:33:13 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu)

Hi,

Whenever I start inferior-haskell process I noticed that whatever I
input to the haskell process, it echoes that back with ^J (2 characters,
^ and J, not single character ^J). To fix this behaviour I've to use the
following EmacsLisp code:

#v+
(with-current-buffer inferior-haskell-buffer
        (add-hook 'comint-preoutput-filter-functions
                                                (lambda (str) 
                                                        
(replace-regexp-in-string ".*^J\\(.*\\)" "\\1" str))))
#v-

This fixes this but I don't think this is any good solution. I think
this has something to do with process or terminal coding, but I'm not
sure what it is.

Following is an interaction with ghci. During the invocation of ghci, I
typed ":t map^M^D" characters on my keyboard:

#v+
% ghci >test.txt
% hexdump -C test.txt
00000000  47 48 43 69 2c 20 76 65  72 73 69 6f 6e 20 36 2e  |GHCi, version 6.|
00000010  31 30 2e 31 3a 20 68 74  74 70 3a 2f 2f 77 77 77  |10.1: http://www|
00000020  2e 68 61 73 6b 65 6c 6c  2e 6f 72 67 2f 67 68 63  |.haskell.org/ghc|
00000030  2f 20 20 3a 3f 20 66 6f  72 20 68 65 6c 70 0a 4c  |/  :? for help.L|
00000040  6f 61 64 69 6e 67 20 70  61 63 6b 61 67 65 20 67  |oading package g|
00000050  68 63 2d 70 72 69 6d 20  2e 2e 2e 20 6c 69 6e 6b  |hc-prim ... link|
00000060  69 6e 67 20 2e 2e 2e 20  64 6f 6e 65 2e 0a 4c 6f  |ing ... done..Lo|
00000070  61 64 69 6e 67 20 70 61  63 6b 61 67 65 20 69 6e  |ading package in|
00000080  74 65 67 65 72 20 2e 2e  2e 20 6c 69 6e 6b 69 6e  |teger ... linkin|
00000090  67 20 2e 2e 2e 20 64 6f  6e 65 2e 0a 4c 6f 61 64  |g ... done..Load|
000000a0  69 6e 67 20 70 61 63 6b  61 67 65 20 62 61 73 65  |ing package base|
000000b0  20 2e 2e 2e 20 6c 69 6e  6b 69 6e 67 20 2e 2e 2e  | ... linking ...|
000000c0  20 64 6f 6e 65 2e 0a 50  72 65 6c 75 64 65 3e 20  | done..Prelude> |
000000d0  3a 74 20 6d 61 70 0a 6d  61 70 20 3a 3a 20 28 61  |:t map.map :: (a|
000000e0  20 2d 3e 20 62 29 20 2d  3e 20 5b 61 5d 20 2d 3e  | -> b) -> [a] ->|
000000f0  20 5b 62 5d 0a 50 72 65  6c 75 64 65 3e 20 5e 44  | [b].Prelude> ^D|
00000100  4c 65 61 76 69 6e 67 20  47 48 43 69 2e 0a        |Leaving GHCi..|
0000010e
#v-

BtW, I'm noticing this behavior since I upgraded to GHC (from 6.8.2 to
6.10.1). I'm using haskell-mode 2.4 and running following version of GNU
Emacs.

GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.14.7)
 of 2009-01-24 on chateau.d.lf

Any ideas what is wrong with ghci or emacs ? And how to properly fix
this problem.

Thanks in advance.
-- 
Ashish SHUKLA


reply via email to

[Prev in Thread] Current Thread [Next in Thread]