473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 2101
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 Hudson "It will likely take a little practice...
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. jfj@cluster:~/> python -V Python 2.3.4...
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 possible for some reason..." -- Peter Hansen...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.