[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggestion for python.el and emacs.py
From: |
Steven Huwig |
Subject: |
Re: Suggestion for python.el and emacs.py |
Date: |
Thu, 24 Mar 2005 22:58:40 -0500 |
On Mar 24, 2005, at 7:54 PM, Dave Love wrote:
Stefan Monnier <address@hidden> writes:
I don't myself use Python, so I don't know what such a patch could
break.
Can someone who's used Python (and the new pyhton-mode) confirm that
this
change is a good idea?
I notice that CVS Emacs now has a python mode. Here is a small patch
to
etc/emacs.py to make the Python shell display objects in a readable
format
(i.e. not putting long lists into a single line but rather adding
newlines
where appropriate).
Presumably Eldoc and completion will fail if the value is broken (in
which case I guess they should protect against that hook being used).
I've checked into that and it doesn't seem to be the case. pprint only
pretty-prints lists, dicts, and objects as far as I can tell. The code
in
emacs.py uses the print statement to display "_emacs_out ..." lines.
Since
print is being called explicitly, displayhook doesn't come into the
picture except to print the result of the print statement (None) after
it is evaluated. That "None" may need to be filtered but it doesn't
seem to break things on my installation.
Anyhow, I don't think it's appropriate for Emacs to override the
user's Python startup like that.
If nothing else in the Python environment is being overridden or having
its behavior changed by Emacs, I agree. Perhaps a line in documentation
or a customization variable would suffice. I have used Emacs and Python
for some time and never really realized that pprint would solve my line
wrap problems so easily until the question was raised for the dozenth
time by the dozenth acquaintance. I'd like to save others the time to
research the same question while making interacting with Python a bit
nicer out-of-the-box in Emacs.
Also it would be better to fix the bugs in python.el...
I do notice that completion doesn't seem to work if an item's list of
attributes is too long (try completing "os.<M-Tab>").
Is that one of these bugs, or have I managed to overlook something?
I only just discovered python.el recently, having used python-mode and
being frustrated by it at various points.
Thanks,
Steven Huwig
- Re: Suggestion for python.el and emacs.py, Stefan Monnier, 2005/03/21
- Re: Suggestion for python.el and emacs.py, Dave Love, 2005/03/24
- Re: Suggestion for python.el and emacs.py, Stefan, 2005/03/24
- Re: Suggestion for python.el and emacs.py,
Steven Huwig <=
- Re: Suggestion for python.el and emacs.py, Dave Love, 2005/03/25
- Re: Suggestion for python.el and emacs.py, Steven Huwig, 2005/03/25
- Re: Suggestion for python.el and emacs.py, Stefan Monnier, 2005/03/26
- Re: Suggestion for python.el and emacs.py, Steven Huwig, 2005/03/26
- Re: Suggestion for python.el and emacs.py, Stefan Monnier, 2005/03/26
- OS X python.el completion issue (was Re: Suggestion for python.el and emacs.py), Steven Huwig, 2005/03/26
- Re: OS X python.el completion issue (was Re: Suggestion for python.el and emacs.py), Steven Huwig, 2005/03/26
- Re: OS X python.el completion issue, Stefan Monnier, 2005/03/26
- Re: OS X python.el completion issue, Steven Huwig, 2005/03/26
- Re: OS X python.el completion issue, Stefan Monnier, 2005/03/26