Skip to content
This repository

changes to get ipython.el to work with the latest python-mode.el #938

wants to merge 1 commit into from

4 participants

deftpunk Min RK Fernando Perez Pete Aykroyd

This is what I saw as the shortest route to a fix. Don't hold back :)

Min RK

I'm not an emacs user, nor familiar with elisp, but am I correct in understanding the changes:

  1. check for the existence of py-python-command before testing equality with ipython-backup-of-py-python-command
  2. only set py-shell-name to ipython-command if py-shell-name is already defined


Fernando Perez

Note: I can't get this to work at all with python-mode 6.0.3 or 6.0.4, though it does work with version 5.2.0. Can you detail precisely how you configured your emacs init file that worked for you? Before we merge this, we need to make sure it does work for at least a few other people and that we document exactly what needs to be done to make it work.

My config (that works with python-mode 5.2.0 but not with 6.0.3+) looks like this:

(require 'ipython)

I tried various combinations of setting the py-shell-name and py-python-command but nothing worked for me.


I am in the middle of changing jobs so have not been able to devote a lot of time.

minrk: Yes, you are understanding correctly. Feel free to contribute thoughts, notes, code, etc.

fperez: I tested w/ python-mode 6.0.3 - I do the following in my init file, which is not ideal but explains why it works for me; I make py-shell-name "global", the ipython require does a python-mode require (python-mode makes py-shell-name a buffer-local variable by default), since py-shell-name is already bound it is then set to the value of ipython-command.

(setq py-shell-name "~/bin/ipython)
(require 'ipython)

I will look a little further into this when I have a spare moment.

I have been trying to get anything-ipython.el working for myself w/out much luck. The first thing I have run into is that it does something funny w/ the full path to ipython. I will try to take a look at this as well.

deftpunk deftpunk reopened this

Crap. Just getting used to github and pull requests, I closed the pull request accidentally, certainly not intentionally.

Fernando Perez

@paykroyd, did you fully integrate @defpunk's code into your #1015? If so, then we can just continue working on #1015 and close this one here, if his commits are fully in your branch. Sorry, I don't have the time right now to check carefully, and since the shas of the commits are different, I wanted to sort it out with you and @deftpunk, so we don't lose code but also so we can close redundant PRs and put all our effort into a single one to improve the emacs situaiton.

Thanks a lot to both of you for pitching in with the emacs help!

Pete Aykroyd

@fperez, yes, I integrated it completely into #1015.

Fernando Perez

Great, closing here then, so we can continue working on #1015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 28, 2011
Erick Bodine my changes to get ipython.el working w/ latest python-mode.el 97d93cc
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. +6 3 docs/emacs/ipython.el
9 docs/emacs/ipython.el
@@ -229,9 +229,12 @@ the second for a 'normal' command, and the third for a multiline command.")
229 229 (t ; default (backg-mode isn't always set by XEmacs)
230 230 "LightBG")))
231 231 py-python-command-args))
232   - (unless (equal ipython-backup-of-py-python-command py-python-command)
233   - (setq ipython-backup-of-py-python-command py-python-command))
234   - (setq py-python-command ipython-command))
  232 + (when (boundp 'py-python-command)
  233 + (unless (equal ipython-backup-of-py-python-command py-python-command)
  234 + (setq ipython-backup-of-py-python-command py-python-command)))
  235 + (setq py-python-command ipython-command)
  236 + (when (boundp 'py-shell-name)
  237 + (setq py-shell-name ipython-command)))
235 238
236 239
237 240 ;; MODIFY py-shell so that it loads the editing history

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.