[IPython-user] Re: Still(!) problems with ipython-emacs-mode

Karl Pflästerer sigurd at 12move.de
Tue Oct 28 11:39:42 CST 2003


On 28 Oct 2003, Jens Brandenburg <- jens_brandenburg at gmx.net wrote:

> It looks like Karl was right. That's why I replaced the older  
> python-mode.el by the one wich can be downloaded under ipython.scipy.net  

That may or may not work.

> ... But this doesn't change anything...  

Sad but let's see.

> I installed my xemacs under: c:\programs\xemacs  
> My HOME directory is c:\  

That's not very good (but should cause no problems).

> python-mode.el is found in  
> c:\programs\xemacs\xemacs-packages\lisp\python-modes  

That's the place where the original python-mode.el lives.  That may
cause problems because the code in the two libs is different and maybe
(I didn't check it) also autoloaded functions had been changed.  But
XEmacs uses for fast loading the file auto-autoloads.el which is in that
directory (it's automatically generated when building the packages).  So
you could have a problem here.

> ipython.el I put in c:\programs\xemacs\xemacs21.4.8\lisp  

That's the wrong place.  In that directory are only XEmacs own core lisp
files.  You shouldn't change there anything.

> init.el is situated in c:\.xemacs  

That right as c:\ is home.

> In the init.el I add the following line:  
> (require 'ipython)  

> So, I think I've done everything necessary, or not??? 

Let's try it in another way (comment that require out for  the moment).

(a) Make a new directory: c:\programs\xemacs\site-packages\lisp\ipython\

(b) Copy there ipython.el and python-mode.el

(c) (re)start XEmacs. Now do `C-h v load-path RET` (that means Control h
    then v (which runs the command `describe-variable')).  That's a long
    list with all directories XEmacs searches for lisp files.  The new
    directory should be there.  You can fast find it with:

    (loop for path in load-path if (string-match "ipython" path) collect path)
    
    Type that form in the *scratch* buffer and press `C-j' after the
    form.  That evaluates it and prints its value in the buffer.

    If you cannot find the new path there then something is wrong.

(d) Supposing everything went right do now: `M-x load-library ipython RET' 
    You should be able to read in the minibuffer:
        Loading ipython...done
        Loading ipython...

(e) Then load a python file or open a new one.  The python-mode should
    automagically be active in tzhe buffer.

(f) Type `C-c !' (or `M-x py-shell RET') Now Ipython should start a new
    process in a new buffer.  It looks like this:
        ,----
        | Python 2.3.2 (#1, Oct  9 2003, 12:03:29) 
        | Type "copyright", "credits" or "license" for more information.
        | 
        | IPython 0.5.0 -- An enhanced Interactive Python.
        | ?       -> Introduction to IPython's features.
        | @magic  -> Information about IPython's 'magic' @ functions.
        | help    -> Python's own help system.
        | object? -> Details about 'object'. ?object also works, ?? prints more.
        | 
        | In [1]: 
        `----

(g) If there are problems with the load-path there are other
    possibilities to frob it.  But let's try the way it's supposed to
    be.


> PS.: What means "IPython will be set as the default python shell, but only 
> if the ipython executable is in the path."? Which path is meant here? 


The path of the shell which XEmacs uses to start a Python process.  That
shell must also be able to find Ipython.  If you start it (eg. cmd.com)
and type ipython, what happens?  Does Ipython start? Or how do you start
Ipython?



   KP

-- 
            One, two!  One, two!  And through and through
                 The vorpal blade went snicker-snack!
          He left it dead, and with its head
                He went galumphing back.   "Lewis Carroll" "Jabberwocky"



More information about the IPython-user mailing list