rev 752 breaks ipython.el, py-mode-map missed

Bug #912919 reported by Thomas Caswell
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler
Gentoo Linux
Expired
Medium

Bug Description

Changing py-mode-map to python-mode-map broke ipython. I have added a hacky fix to their tracking.

https://github.com/ipython/ipython/pull/1242

Tags: ipython
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 912919] [NEW] rev 752 breaks ipython

Am 06.01.2012 21:57, schrieb Thomas Caswell:
> Public bug reported:
>
> Changing py-mode-map to python-mode-map broke ipython. I have added a
> hacky fix to their tracking.
>
> https://github.com/ipython/ipython/pull/1242
>

Hi,

need some recipe to reproduce.
Completion in IPython works fine here with TAB.

Did you patch against current trunk?

BTW have a look at

defcustom py-complete-function

thanks,

Andreas

Changed in python-mode:
importance: Low → Medium
status: New → Incomplete
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.5
Revision history for this message
Thomas Caswell (tcaswell-gmail) wrote : Re: rev 752 breaks ipython

When I switch to python-mode I get the error:

File mode specification error: (void-variable py-mode-map)

The change in 752 was renaming py-mode-map to python-mode-map. The change to ipython.el is the matching rename.

Sorry for the poor bug report.

Revision history for this message
Thomas Caswell (tcaswell-gmail) wrote :

I was using the latest trunk/master for both python-mode and ipython

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 912919] Re: rev 752 breaks ipython

Am 09.01.2012 19:45, schrieb Thomas Caswell:
> I was using the latest trunk/master for both python-mode and ipython
>

still need some description how the bug is triggered.

Please send output from M-x report-emacs-bug when bug occurs.

thanks,

Andreas

Revision history for this message
Thomas Caswell (tcaswell-gmail) wrote : Re: rev 752 breaks ipython
Download full text (23.7 KiB)

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org. Please check that
the From: line contains a valid email address. After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug. If you can, give a recipe
starting from `emacs -Q':

$ emacs -Q

;; to get ipython.el in the path
(add-to-list 'load-path "~/.emacs.d")
;; to get the trunk version of python-mode in the path
(setq load-path (append load-path (list "~/.emacs.d/python-mode")))
(require 'python)
(require 'ipython)

;; open (or reload) a .py file to trigger switching to python-mode

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/home/tcaswell/local_installs/share/emacs/24.0.92/etc/DEBUG.

In GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, X toolkit)
 of 2012-01-04 on innoue
Windowing system distributor `The X.Org Foundation', version 11.0.11102902
configured using `configure '--prefix=/home/tcaswell/local_installs' '--with-gif=no' '--with-x-toolkit=lucid''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  value of $XMODIFIERS: nil
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t

Major mode: Python

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f p y <tab> l <tab> i <tab> g <tab> o <tab> .
<tab> <return> M-x m e <tab> s <tab> <M-backspace>
<escape> <escape> <escape> C-x b m e s <tab> <M-backspace>
C-g M-x p y - s h e l l <return> <C-backspace> <M-backspace>
C-g C-g C-x C-f <M-backspace> <M-backspace> . e m <tab>
<return> <down> <down> <down> <down> <down> <end> C-x
C-e C-x b <return> C-x C-v <return> C-x b <return>
C-s p y t h o n <down> <down> <down> <up> <end> C-x
C-e <down> C-x C-e <down> <end> C-x C-e C-x b <return>
C-x C-v <return> M-x r e p o <tab> r <tab> <return
>

Recent messages:
Loading vc-git...done
Making completion list...
Quit [4 times]
("~/.emacs.d" "/home/tcaswell/local_installs/share/emacs/24.0.92/site-lisp" "/home/tcaswell/local_installs/share/emacs/site-lisp" "/home/tcaswell/local_installs/share/emacs/site-lisp/a2ps" "/home/tcaswell/local_installs/share/emacs/site-lisp/apel" "/home/tcaswell/local_installs/share/emacs/site-lisp/auctex" "/home/tcaswell/local_installs/share/emacs/site-lisp/autoconf" "/home/tcaswell/local_installs/share/emacs/site-lisp/bitmap-mule" "...

Revision history for this message
Thomas Caswell (tcaswell-gmail) wrote :

subsequent attempts to use py-execute-buffer give the error:

ipython-shell-hook: Symbol's value as variable is void: py-mode-map

and nothing is executed.

I also noticed that the above recipe launches an IPython session on it's own. I am not sure if that is the intended behavior.

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 912919] Re: rev 752 breaks ipython

Am 09.01.2012 22:11, schrieb Thomas Caswell:
> This bug report will be sent to the Bug-GNU-Emacs mailing list
> and the GNU bug tracker at debbugs.gnu.org. Please check that
> the From: line contains a valid email address. After a delay of up
> to one day, you should receive an acknowledgement at that address.
>
> Please write in English if possible, as the Emacs maintainers
> usually do not have translators for other languages.
>
> Please describe exactly what actions triggered the bug, and
> the precise symptoms of the bug. If you can, give a recipe
> starting from `emacs -Q':
>
> $ emacs -Q
>
> ;; to get ipython.el in the path
> (add-to-list 'load-path "~/.emacs.d")
> ;; to get the trunk version of python-mode in the path
> (setq load-path (append load-path (list "~/.emacs.d/python-mode")))
> (require 'python)
> (require 'ipython)
>

hmm, ipython.el is no longer needed.

Just don't load it for the moment.

Should we re-install py-mode-map in order to provide backward
compatibility, serve existing customizations?

CC to Barry,

thanks for the report,

Andreas

summary: - rev 752 breaks ipython
+ rev 752 breaks ipython.el
Changed in python-mode:
status: Incomplete → Triaged
Changed in python-mode:
status: Triaged → Fix Committed
Revision history for this message
Barry Warsaw (barry) wrote : Re: rev 752 breaks ipython.el

BTW, I'm just looking at this bug because it affects me too. Renaming py-mode-map to python-mode-map broke my customizations. I'm willing to change them though.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

being well aware of the set-backs
a couple of bugs are gone now

made up a new branch py-mode-map

    `python-mode-map' replaced by `py-mode-map' again

    this doesn't make the key for
     [(control c)(control n)] 'py-end-of-statement)

    for example

    any ideas why?

summary: - rev 752 breaks ipython.el
+ rev 752 breaks ipython.el, py-mode-map missed
Changed in python-mode:
status: Fix Committed → In Progress
Changed in python-mode:
status: In Progress → Incomplete
Changed in python-mode:
milestone: 6.0.5 → none
assignee: Andreas Roehler (a-roehler) → nobody
importance: Medium → Undecided
Revision history for this message
In , JF Ostiguy (jfostiguy) wrote :

Recent versions of app-emacs/python-mode no longer define the variable py-mode-map which dev-python/ipython assumes exists. See bug 407179 for further explanations.

dev-python/ipython-0.12-r1 needs RDEPEND <=app-emacs/python-mode-6.0.3-r1
The ipython maintainer should probably report the issue upstream.

Reproducible: Always

Revision history for this message
In , Ulrich Müller (ulm) wrote :

The issue is already known upstream, see URL.

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 912919] Re: rev 752 breaks ipython.el, py-mode-map missed

Am 10.03.2012 22:38, schrieb Ulrich Müller:
> ** Bug watch added: Gentoo Bugzilla #407715
> http://bugs.gentoo.org/show_bug.cgi?id=407715
>
> ** Also affects: gentoo via
> http://bugs.gentoo.org/show_bug.cgi?id=407715
> Importance: Unknown
> Status: Unknown
>

Hi,

inserting below definition of python-mode-map

(setq py-mode-map python-mode-map)

should fix it.

Can you try that?

Thanks,

Andreas

Changed in python-mode:
status: Incomplete → New
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.6
Revision history for this message
Andreas Roehler (a-roehler) wrote :

python-mode now provides a

(defvar py-mode-map python-mode-map)

this should do it.

Please re-open if not.

Cheers,

Andreas

Changed in python-mode:
status: New → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
Revision history for this message
In , Fiolj (fiolj) wrote :

Hi, I had the same problem and solved it by emerging ipython with useflag "-emacs". I did not find any problem with this. It seems that the problem is that ipython installs ipython.el that interacts with python-mode. May be the solution would be that the useflag "emacs" requires *only* python-mode and not install ipython.el
Juan

Changed in gentoo:
importance: Unknown → Medium
Revision history for this message
In , Ondrej-grover (ondrej-grover) wrote :

So far the best workaround seems to be to alias that variable in .emacs

(require 'python-mode)
(setq py-mode-map python-mode-map)

Maybe something like that should be added to a site-gentoo.d/ file for python-mode, for backwards compatibility.

something like

(add-hook 'python-mode-hook
    (lambda ()
        (defvaralias 'py-mode-map 'python-mode-map)))

But I wasn't able to get that working.

Revision history for this message
In , Andreas Roehler (a-roehler) wrote : Re: [Bug 912919]

Am 11.08.2013 11:40, schrieb Ondrej-grover:
> So far the best workaround seems to be to alias that variable in .emacs
>
> (require 'python-mode)
> (setq py-mode-map python-mode-map)
>
>
> Maybe something like that should be added to a site-gentoo.d/ file for python-mode, for backwards compatibility.
>
> something like
>
> (add-hook 'python-mode-hook
> (lambda ()
> (defvaralias 'py-mode-map 'python-mode-map)))
>
> But I wasn't able to get that working.
>

(defvaralias 'py-mode-map 'python-mode-map)

is delivered by python-mode.el.

Revision history for this message
In , Marbre (marbre) wrote :

This version isn't in the tree anymore. Issue should be closed.

Revision history for this message
In , Justin (jlec) wrote :

Please reopen if still exists with >ipython-2

Changed in gentoo:
status: Unknown → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.