setting imenu-create-index-p to nil causes an error if imenu is already loaded

Bug #945597 reported by Jan Domurath
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

Hi,

if i disable imenu with:

   (setq imenu-create-index-p nil)

i get the following error:

   File mode specification error: (error "The mode `Python' does not support Imenu")

As far as i could figure it out, the error arises when imenu is already loaded.
Then (fboundp 'imenu-add-to-menubar) evaluates to true and it is tried to add
the PyIndex menu which "isn't defined" at this point.

I would propose the attached patch to fix this issue.
This way, it is only tried to add the PyIndex menu if imenu-create-index-p is
non nil.

-Jan

Revision history for this message
Jan Domurath (jan-domurath) wrote :
Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.5
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi,

thanks a lot for the patch, you got the right spot.

May you check out the current trunk and try again?

Andreas

Changed in python-mode:
status: Confirmed → Fix Committed
Revision history for this message
Jan Domurath (jan-domurath) wrote :

Hi,

thanks for fixing it, so quickly!

Just tried and it works like a charm.

-Jan

Changed in python-mode:
status: Fix Committed → Fix Released
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.