[IPython-user] color with ipython inside emacs

Dan Christensen jdc at uwo.ca
Fri Dec 31 08:54:24 CST 2004

Alexander Schmolck <a.schmolck at gmx.net> writes:

> Dan Christensen <jdc at uwo.ca> writes:
>> Fernando Perez <fperez528 at yahoo.com> writes:
>>> * Added ipython.el to the end-user distribution, for (X)Emacs support, since 
>>> now the official python-mode.el from
>>> http://sourceforge.net/projects/python-mode
>>> has all the necessary fixes for ipython support (in CVS at this moment).
>> I've never been able to get color working when using ipython within
>> emacs (21.3).  I just see various control codes in the *Python Output*
>> buffer.  I'm using ipython 0.6.5, ipython.el 1.8, python-mode 4.69
>> from CVS and ansi-color 3.4.5.  This happens with an empty .emacs and
>> `M-x load-library RET /path/to/ipython.el' in a fresh emacs.
> Depends on -- are you using windows? In which case my suggestion would be to
> replicate the problem under a unix machine [1], otherwise I'd suggest you:

Sorry for not providing basic information above.  I use Debian,
including Debian's version of emacs 21.3 and ipython 0.6.5, but my own
(newer) versions of ipython.el, python-mode.el and ansi-color.el.

> a) see what happens if you do M-x term -- do you get nice colour output or
>    not (after typing, say ``ls --color``)? What happens if you try the
>    same after running emacs with:
>      emacs -q
>    ?

If I do "emacs -q" and then `M-x term', everything is fine.  "ls
--color" produces color output, and ipython works fine in that
terminal, with color.

If I do "emacs -q" and then 
`M-x load-library RET /home/jdc/emacs/lisp/ansi-color.el RET 
 M-x ansi-color-for-comint-mode-on
 M-x shell'
then again everything works fine (except that a few control characters
in my prompt show up in the buffer).

If I do "emacs -q" and eval

(setq load-path 
      (append (list "~/emacs/lisp"    
(require 'ipython)

and then `C-x C-f /tmp/test.py RET' and `C-c C-c', I get no color at
all in the *Python Output* buffer, just lots of control characters.
Also, ansi-color-for-comint-mode's value is nil.  If I manually
run ansi-color-for-comint-mode-on, and then do `C-c C-c' again,
there is no change.

Let me know what other information would be useful.



More information about the IPython-user mailing list