py-up/down-exception finds wrong comint/py-shell buffer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
High
|
Andreas Roehler |
Bug Description
Hi,
Thanks for the great work on python-mode.el, especially integration of IPython into the main python-mode. I find one of the most useful functions from the I/Python shell py-up-exception, which unfortunately works only with the Python inferior shell and not IPython or the dedicated shells.
The IPython exception reporting is differently formatted. Changing py-traceback-
(defun py-up-exception (&optional top)
"Go to the previous line up in the traceback.
With \\[universal-
jump to the top (outermost) exception in the exception stack."
(interactive "P")
(let* ((proc (get-process "Python"))
(buffer (if proc "*Python*" py-output-buffer)))
(if top
(
Hacking "Python" to "IPython" and *Python* to *IPython* makes py-up-exception work for IPython, but of course breaks it for Python, and neither works for dedicated py-shells. Just making buffer (current-buffer) works for the *first* exception, but py-up-exception is bound to C-c - python code buffers too, so it doesn't work for subsequent invocations. I can't provide a patch (sorry) because I don't understand the logic for getting hold of the correct comint buffer for the various py-shells.
It seems potentially complicated: maybe a solution would be to remember the last "active" py-shell or the last comint buffer from which py-up/down-
Thanks again,
Richard.
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
milestone: | none → 6.0.5 |
importance: | Undecided → Medium |
Changed in python-mode: | |
status: | New → In Progress |
Changed in python-mode: | |
importance: | Medium → High |
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Am 02.01.2012 11:58, schrieb Richard Everson:
Hi,
beside the whole bunch of bugs you pointed at, looks like a bug lives
already in
py-jump- to-exception, at
(pop-to-buffer buffer)
;; Force Python mode
setting an Emacs lisp buffer here onto python-mode...
In order to fix things one-by-one, could you send me an example which
works with common Python shell?
Thanks,
Andreas