[IPython-user] Re: XEmacs execute buffers/regions only once

Alexander Schmolck a.schmolck at gmx.net
Sun Jul 18 15:40:26 CDT 2004


Alexis Gallagher <alexis at alexisgallagher.com> writes:

> Hi Alexander,
>
> Thanks for the reply.
>
> You'll be happy to know I've gotten to the bottom of at least half of the
> problem, and I think what I figured out may benefit others as well. The
> commands py-execute-* now process the buffers fully, and don't require the
> queues to be manually cleared. (The prompt colorization is still not working,
> however.)
>
>  >
>  > py-comint-output-filter-function (in python.el) might be a good start.
>  >
>
> I took your advice and and went looking in this file. (It's actually called
> python-mode.el.) Under closer inspection, I couldn't find anything in it
> referring to ipython at all, and I could see hard-coded strings that clearly
> matched the ordinary python prompt.

Yes, I submitted a patch to python-mode.el ages ago that fixed that
hard-coding problem. Unfortunately it hasn't been accepted (presumably because
Barry, who was then the sole maintainer was very busy at the time) and now the
old patch won't work with the CVS version of python-mode.el. That's why
ipython-mode.el should come bundled with a patched old version of
python-mode.el, but Fernando has apparently included the wrong version of
python-mode.el in his latest tar ball as you have found out (but I'm pretty
sure he's already fixed that problem).

Unfortunately I currently have no time at all to look at what's changed in
python-mode.el so that the patch will no longer word (I couldn't immediately
find the problem last time I tried) so unless someone on this list has some
time and the necessary expertise to create a suitable patch for newer versions
of python-mode.el (and bug the maintainers to incorporate it, so that it won't
have to be done yet another time) those who want to use ipython within emacs
will for now have to live with an older version of python-mode.el.

> I double checked that the file was shadowing the generic python-mode.el --
> fine. I double checked that I was using the python-mode.el that is distributed
> with ipython-emacs-0.3.tgz -- fine. Then I double-checked that this was the
> same as the version you had sent me in an earlier email -- bingo!
>
> It seems that the ipython-emacs-0.3.tgz distributed on the website (at least,
> at http://ipython.scipy.org/dist/ ), has the a generic python-mode.el rather
> than the one modified to work with ipython. At least, when I swapped in your
> python-mode.el it started working with a hitch.
>
> I'm a little embarassed it was a simple as this, since I thought I'd already
> checked with the files you sent me. I think I had checked -- but only for the
> colorization problem.

Believe me, I can relate to this sort of mistake. However, *should* you be
feeling an inappropriate sense of guilt, I'd be more than happy to exploit
that too -- as I said it would be great if someone could find the time to get
the necessary changes into the official python-mode.el ;)

> I'm going to tackle the font colorization a bit later. I thought you'd want to
> know in case the version on the ftp server should be updated.

Thanks -- I just had an exchange with Fernando and it indeed seems to be the
case that the wrong python-mode.el crept into the tgz again, but that should
be already fixed by now (or in the very near future).

Thanks for your help and feedback.

'as




More information about the IPython-user mailing list