472,353 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

python-mode is missing the class browser

I have noticed that the python-mode for Emacs that comes with the
latest Ubuntu is missing the class browser. Moreover if works
differently from the python-mode I was used to (for instance CTRL-c-c
works as CTRL-c-! whereas CTRL-c-! is missing, etc). How can I go back
to the old python-mode
or at least how do I get back the class browser?

Michele Simionato
Aug 7 '08 #1
7 2004
Michele Simionato a écrit :
I have noticed that the python-mode for Emacs that comes with the
latest Ubuntu is missing the class browser. Moreover if works
differently from the python-mode I was used to (for instance CTRL-c-c
works as CTRL-c-! whereas CTRL-c-! is missing, etc). How can I go back
to the old python-mode
or at least how do I get back the class browser?
I'm not really up2date wrt/ my ubuntu station here, but I remember
having seen this somewhat different (emacs-provided IIRC) python-mode
which I didn't like. I don't quite remember what I did, but I can at
least tell you what I have actually have:

- in /usr/share/emacs/site-lisp/python-mode/python-mode.el : the 'true'
python-mode which header goes like this:
"""
;;; python-mode.el --- Major mode for editing Python programs

;; Copyright (C) 1992,1993,1994 Tim Peters

;; Author: 2003-2006 http://sf.net/projects/python-mode
;; 1995-2002 Barry A. Warsaw
;; 1992-1994 Tim Peters
;; Maintainer: py*********@python.org
;; Created: Feb 1992
;; Keywords: python languages oop

(defconst py-version "$Revision: 4.78 $"
"`python-mode' version number.")
"""

- in /usr/share/emacs/22.0.91/site-lisp/python-mode/ : the corresponding
byte-compiled python-mode.elc

- in /etc/emacs/site-start.d/ : a 50python-mode.el file that reads:
"""
;-*-emacs-lisp-*-

(autoload 'python-mode "python-mode" "Python editing mode." t)
(autoload 'py-shell "python-mode" "Interactive Python interpreter." t)
(autoload 'doctest-mode "doctest-mode" "Python doctest editing mode." t)

(setq load-path
(append
(list
(concat "/usr/share/"
(symbol-name debian-emacs-flavor)
"/site-lisp/python-mode")
(concat "/usr/share/"
(symbol-name debian-emacs-flavor)
"/site-lisp/pymacs")
)
load-path))

(setq auto-mode-alist
(append
(list
'("\\.py$" . python-mode)
'("SConstruct$" . python-mode)
'("SConscript$" . python-mode)
)
auto-mode-alist))

(setq interpreter-mode-alist
(append
(list
'("python" . python-mode)
'("python2.1" . python-mode)
'("python2.2" . python-mode)
'("python2.3" . python-mode)
'("python2.4" . python-mode)
'("python2.5" . python-mode)
)
interpreter-mode-alist))
"""

emacs-version : GNU Emacs 22.0.91.1 (i486-pc-linux-gnu, GTK+ Version
2.10.6) of 2006-12-20 on rothera, modified by Debian

ubuntu Feisty Fawn (7.04)

FWIW and talking about class-browser, there's the IMHO very excellent
emacs-code-browser too.

HTH
Aug 7 '08 #2
Michele Simionato <mi***************@gmail.comwrites:
I have noticed that the python-mode for Emacs that comes with the
latest Ubuntu is missing the class browser. Moreover if works
differently from the python-mode I was used to (for instance CTRL-c-c
works as CTRL-c-! whereas CTRL-c-! is missing, etc). How can I go back
to the old python-mode
or at least how do I get back the class browser?
There are two different and independently developedpython-modes. The
politically correct one that comes with emacs (IIRC python.el) that had pretty
limited functionality last time I looked, and the original but not FSF blessed
python-mode.el (http://sourceforge.net/projects/python-mode/), which should
come with install instructions. If you use ipython you might additionally
want to install ipython.el, which comes with the ipython tar ball.

cheers

'as
Aug 7 '08 #3
Bruno Desthuilliers wrote:
Michele Simionato a écrit :
>I have noticed that the python-mode for Emacs that comes with the
latest Ubuntu is missing the class browser. Moreover if works
differently from the python-mode I was used to (for instance CTRL-c-c
works as CTRL-c-! whereas CTRL-c-! is missing, etc). How can I go back
to the old python-mode
or at least how do I get back the class browser?

I'm not really up2date wrt/ my ubuntu station here, but I remember
having seen this somewhat different (emacs-provided IIRC) python-mode
which I didn't like. I don't quite remember what I did, but I can at
least tell you what I have actually have:
<snip/>

I've got the same, and a IM-Python-menu that contains the class-browser.

FWIW and talking about class-browser, there's the IMHO very excellent
emacs-code-browser too.
Yes, it sure is cool.

And I have no idea how I ever worked without flymake & pylint :)

Emacs just rocks...
Diez
Aug 7 '08 #4
On Aug 7, 5:55*pm, Alexander Schmolck <a.schmo...@gmail.comwrote:
There are two different and independently developedpython-modes. The
politically correct one that comes with emacs (IIRC python.el) that had pretty
limited functionality last time I looked, and the original but not FSF blessed
python-mode.el (http://sourceforge.net/projects/python-mode/), which should
come with install instructions. If you use ipython you might additionally
want to install ipython.el, which comes with the ipython tar ball.
I have solved by using ipython.el which was already installed. For the
sake of
future googlers using Ubuntu 8.04, emacs and ipython, it is enough if
you just add

(setq ipython-command "/usr/bin/ipython")
(require 'ipython)

to your .emacs. It is nice since I get the occasion to try ipython.el
which I am
sure I will like ;)

M. Simionato
Aug 8 '08 #5
On Fri, Aug 8, 2008 at 7:32 AM, Michele Simionato
<mi***************@gmail.comwrote:
On Aug 7, 5:55 pm, Alexander Schmolck <a.schmo...@gmail.comwrote:
....
>
I have solved by using ipython.el which was already installed. For the
sake of
future googlers using Ubuntu 8.04, emacs and ipython, it is enough if
you just add

(setq ipython-command "/usr/bin/ipython")
(require 'ipython)

to your .emacs. It is nice since I get the occasion to try ipython.el
which I am
sure I will like ;)
So, I'm looking at the .el, but I'm not sure. What else does
ipython.el give you than just the ipython shell?
>
M. Simionato
--
http://mail.python.org/mailman/listinfo/python-list
Aug 8 '08 #6
"Adam Jenkins" <em**********@gmail.comwrites:
On Fri, Aug 8, 2008 at 7:32 AM, Michele Simionato
<mi***************@gmail.comwrote:
>On Aug 7, 5:55 pm, Alexander Schmolck <a.schmo...@gmail.comwrote:
...
>>
I have solved by using ipython.el which was already installed. For the
sake of
future googlers using Ubuntu 8.04, emacs and ipython, it is enough if
you just add

(setq ipython-command "/usr/bin/ipython")
(require 'ipython)

to your .emacs. It is nice since I get the occasion to try ipython.el
which I am
sure I will like ;)

So, I'm looking at the .el, but I'm not sure. What else does
ipython.el give you than just the ipython shell?
What else could you possibly want? :)

Seriously, ipython.el is a simple kludge whose only function is to make
python-mode work with ipython (rather than python[*]). Despite this certain
primitiveness (c.f. slime), Emacs+ipython makes quite a powerful development
environment, significantly more so than ipython alone or emacs + python. Most
importantly thre is:

1. debug. Try it: write some code that will throw an unhandled exception, and
just type ``debug``. Type ``u`` and ``d`` to go up and down the stack
frame, and see the right file and line pop up in emacs. I really find that
combined with the ability to do arbitrary things with the things I find on
the stack incredibly useful for development.

2. ? and ?? as well as ed. To get help on foo you just write ``foo?``. To get
its source code as well type ``foo??``. Finally to edit the code that
correspond's to foo's class or function definition (also works on class
instances)) type ``ed foo`` (IIIRCk the default behavior is autoexecution,
so you might want to re-alias).

3. Autocompletion with tab.

4. run (including -d and -p options). Try ``run?``

5. Matplotlib and gui stuff works interactively. (-pylab cmdline option)

6. Convenient Shell interaction (ls, !, int) and interpolation from and too
python

7. Pretty printing.

But there's plenty more stuff. The most useful in terms of added functionality
via emacs is 1, but isearch and emacs editing power make the ipython shell
output also noticably more useful (and thus things like ?, ?? and pretty
printing).

cheers,

'as
[*] Inter alia the prompt parsing stuff needs to be different and the ansi
color formatting needs to be dealt with.
Aug 8 '08 #7
>Alexander Schmolck wrote:
"Adam Jenkins" <em**********@gmail.comwrites:
>On Fri, Aug 8, 2008 at 7:32 AM, Michele Simionato
<mi***************@gmail.comwrote:
>>On Aug 7, 5:55 pm, Alexander Schmolck <a.schmo...@gmail.comwrote:
...
>>>
I have solved by using ipython.el which was already installed. For the
sake of
future googlers using Ubuntu 8.04, emacs and ipython, it is enough if
you just add

(setq ipython-command "/usr/bin/ipython")
(require 'ipython)

to your .emacs. It is nice since I get the occasion to try ipython.el
which I am
sure I will like ;)

So, I'm looking at the .el, but I'm not sure. What else does
ipython.el give you than just the ipython shell?

What else could you possibly want? :)

Seriously, ipython.el is a simple kludge whose only function is to make
python-mode work with ipython (rather than python[*]). Despite this
certain primitiveness (c.f. slime), Emacs+ipython makes quite a powerful
development environment, significantly more so than ipython alone or emacs
+ python. Most importantly thre is:

1. debug. Try it: write some code that will throw an unhandled exception,
and
just type ``debug``. Type ``u`` and ``d`` to go up and down the stack
frame, and see the right file and line pop up in emacs. I really find
that combined with the ability to do arbitrary things with the things I
find on the stack incredibly useful for development.

2. ? and ?? as well as ed. To get help on foo you just write ``foo?``. To
get
its source code as well type ``foo??``. Finally to edit the code that
correspond's to foo's class or function definition (also works on class
instances)) type ``ed foo`` (IIIRCk the default behavior is
autoexecution, so you might want to re-alias).

3. Autocompletion with tab.

4. run (including -d and -p options). Try ``run?``

5. Matplotlib and gui stuff works interactively. (-pylab cmdline option)

6. Convenient Shell interaction (ls, !, int) and interpolation from and
too
python

7. Pretty printing.

But there's plenty more stuff. The most useful in terms of added
functionality via emacs is 1, but isearch and emacs editing power make the
ipython shell output also noticably more useful (and thus things like ?,
?? and pretty printing).

cheers,

'as
[*] Inter alia the prompt parsing stuff needs to be different and the ansi
color formatting needs to be dealt with.
--
Unfortunately, ipython.el seems to be incompatible with use on your own scripts if they process command line options (e.g., optparse).

Aug 8 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Emile van Sebille | last post by:
QOTW: "Have you ever used the copy module? I am *not* a beginner, and have used it *once* (and I can't remember what for, either)." -- Michael...
1
by: Jerald | last post by:
Running python 2.3.4 on valgrind (a tool like purify which checks the use of uninitialized memory, etc), gives a lot of errors. See below. ...
0
by: Cliff Wells | last post by:
QOTW: "I find it hard to believe nobody has tried this yet, unless it's the case that those who know how to do it also know that it's actually not...
0
by: Josiah Carlson | last post by:
QOTW: "I still think this is a silly idea, but at least it doesn't track mud all over Python's nice clean rugs." -- Michael J. Fromberger...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.