[IPython-user] NTEmacs + ipython: almost completely functional!!

Mike Krell spamaccount10000 at yahoo.com
Sun Apr 24 16:27:53 CDT 2005


I did some more digging and have gotten past the two
major issues I had with IPython under NTEmacs:

1.  Extraneous ^A and ^B characters in prompt -- a
similar problem was reported with running bash under
emacs a while back.  See:

http://lists.gnu.org/archive/html/emacs-pretest-bug/2003-05/msg00112.html

The result was that a bug report was submitted for
bash.     A workaround is to add a hook so that emacs
will filter out the garbage characters.  I adapted it
for comint mode (replaced 'shell-mode-hook with
'comint-mode-hook) and it works fine.

2.  No output from python --  I did some debugging in
console.py (part of the readline implementation).  It
turned out that all the console API calls being made
on the standard output handle were failing with an
error code of 6 (invalid handle) even though the
handle value itself looked valid.  The online docs for
WriteConsole say that it will fail if used on a
standard handle which has been redirected to a file,
and suggests using WriteFile instead.  Sure enough, I
changed the lines in write_color and write_plain to
call WriteFile, and I now get output and error
messages like I expect.  One limitation is that the
SetConsoleTextAttribute call is still failing.  This
means colorized output does not work, but at least
IPython is usable in this state.

  Mike
        

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the IPython-user mailing list