[IPython-user] Getting IPython working with NTEmacs

R. Bernstein rocky@panix....
Wed Feb 14 14:00:49 CST 2007


Been looking at over the last couple of days. In sum looks good! In
fact so good it's inspired a couple of patches of my own.

I don't see any patch to ipython.el, just Debugger.py. And although
there is nothing windows-specific, I did try on Windows XP via VMWare
on Emacs outside of and including the one for cygwin.

About the attached patch I've added. Basically it passes along the
color scheme in effect when the %pydb magic creates a new debugger.

Also I added a close() for IOStream since pydb can close
streams. Since I gather in ipython one doesn't really want to close
the stream we just "pass".

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipy_pydb.diff
Type: application/octet-stream
Size: 1104 bytes
Desc: Pass color scheme in %pydb magic. Add no-op IOStream.close
Url : http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070214/971e3177/attachment.obj 
-------------- next part --------------


Ville M. Vainio writes:
 > Can any other ntemacs user give this a spin before I (blindly) commit
 > it? Yet again, I don't have access to my win32 machine during
 > february.
 > 
 > On 2/11/07, DaveS <davls@telus.net> wrote:
 > > I had a few issues getting IPython working smoothly with NTEmacs so I
 > > thought I would share my findings.
 > >
 > > First of all, my setup:
 > > NTEmacs 21.3.1
 > > Python 2.5
 > > IPython 0.7.3
 > > pydb 1.20
 > >
 > > I made some changes to Debugger.py for both pdb and pydb
 > > compatibility. (diff attached)
 > >  * add trailing space to prompts so emacs sees it. (python 2.5 case)
 > >  * set self.prompt for pydb
 > >  * pydb writes output to it's out stream in a least one spot (list command)
 > >  which causes problems with colours, so I initialized stdout to Term.cout.
 > >  This doesn't seems to cause any new problems.
 > >  * format_stack_entry was placing the '>' carrot on every frame, which
 > >  confused emacs, so I changed it to only place it on the current frame. (I
 > >  think plain pdb works this way)
 > >  * I tweaked the frame line colours to make things clearer. (this is
 > >  subjective but I like it better)
 > >
 > > A couple of minor items in ipython.el
 > >  * (setq py-pydbtrack-input-prompt...  should be
 > >  (setq pydb-pydbtrack-input-prompt
 > >  * I modified py-traceback-line-re to ignore '>' marked stack frames.
 > > (setq py-traceback-line-re
 > >            "\\(^[^\t >].+?\\.py\\).*\n   +[0-9]+[^\00]*?\n-+> \\([0-9]+\\)+")
 > >
 > > Also one minor item.  When using 'run -d' with pydb, no initial breakpoint
 > > gets set, so the instruction about using 'c' to start things gives a
 > > different result then when using pdb.
 > >
 > > After making these changes IPython and Emacs are working great together.
 > >
 > >
 > >
 > > --
 > > DS
 > >
 > > _______________________________________________
 > > IPython-user mailing list
 > > IPython-user@scipy.org
 > > http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
 > >
 > >
 > >
 > 
 > 
 > -- 
 > Ville M. Vainio - vivainio.googlepages.com
 > blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
 > 


More information about the IPython-user mailing list