emacs does not depend on python-mode

Bug #374797 reported by Mario Frasca on 2009-05-11
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
emacs22 (Ubuntu)
Undecided
Unassigned
pylint (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: emacs22-gtk

I have python-minimal (2.6.2-0ubuntu1) and emacs22-gtk (22.2-0ubuntu2) on a fresh installed 9.04 system.
the first I load a .py file and I get (in the *Messages* buffer):
>Loading python...done
>File mode specification error: (void-variable py-mode-map)

any subsequent time I open a .py file I get the above second error message line.
the python source is correctly highlighted.
I would like not getting this error message.

I scanned the Debian bugs site and I think that this is relevant information:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=475939

I sort of understood that to avoid that error message I could try installing the 'python-mode' package explicitly.
>--\ Packages being automatically installed to satisfy dependencies (2)
>piA pychecker +909kB <none> 0.8.18-1
>ciA pymacs +516kB <none> 0.23-1.1
>--\ Packages to be installed (1)
>ci python-mode +389kB <none> 1:5.1.0-1

and it now works better for impatient me.
in particular, the first time I load a python source, I get this in *Messages*:
>Loading python-mode...done
>Local value of py-indent-offset set to 4
>Using the CPython shell

did I in my scanning, running and impatience miss something basilar?
otherwise, wouldn't it be a good idea to add a dependency here?

era (era) wrote :

While the python-mode add-on may be desirable for Python programmers, Emacs is used by people who are not Python programmers or who for other reasons do not want or need the add-on.

As per comments in Debian bug #475939 the reverse can be arranged, i.e. python-mode can coexist with emacs22, but that seems tangential to the error message you are reporting.

However, I was unable to reproduce the error on a fresh install of 9.04 with emacs22-gtk.

If you are able to reproduce the bug, could you M-: (setq debug-on-error t) before loading a ,py file for the first time, and post the resulting *Backtrace* buffer here.

Also, could you please indicate whether the error is reproducible with emacs -q on your system. Thanks.

I am setting the status of this bug to "Incomplete" to indicate that we need more information from you in order to investigate this bug report. Once the requested information is added here, feel free to set it back to "New".

Changed in emacs22 (Ubuntu):
status: New → Incomplete
Phil Sung (psung) wrote :

Here is a recipe for reproduction, I believe. As the Debian bug suggests, the problem is really with pylint, which works with python-mode but not with emacs's built-in python.el. The function causing trouble is pylint-python-hook in /usr/share/emacs/site-lisp/pylint/pylint.el.

(On Ubuntu 9.04)
1. Install emacs22-gtk and pylint.
2. $ emacs -q
3. C-x C-f /any/python/file.py RET

Debugger entered--Lisp error: (void-variable py-mode-map)
  pylint-python-hook()
  run-hooks(python-mode-hook)
  apply(run-hooks python-mode-hook)
  run-mode-hooks(python-mode-hook)
  python-mode()
  set-auto-mode-0(python-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer lws> "~/scripts/lws" nil nil "~/scripts/lws" (447726 2049))
  find-file-noselect("~/scripts/lws" nil nil t)
  find-file("~/scripts/lws" t)
  call-interactively(find-file)

era (era) wrote :

So basically pylint should depend on python-mode, but of course that would cause it to pull in Emacs when you install pylint. Hmm. How about adding that as a Suggests: at least?

Changed in emacs22 (Ubuntu):
status: Incomplete → New
era (era) wrote :

The bug is definitely in pylint, but I'm leaving the bug task for emacs22 open still, since this might still require coordination or at least triage from the Emacs side. pylint's elisp code should definitely depend on python-mode in one way or another, or not relquire functionality which is not present in the "plain Jane" python-mode installed as part of the emacs22 package.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers