An Emacs mode for editing Python code

defvar of outline-heading-end-regexp breaks other packages

Reported by Thomas Caswell on 2012-12-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Medium
Andreas Roehler

Bug Description

line 1321 of python-mode.el is:

(defvar outline-heading-end-regexp nil)

which breaks outline mode, which is used for other packages (like org-mode). This line should be removed.

Thomas Caswell (tcaswell-gmail) wrote :
Andreas Roehler (a-roehler) wrote :

Please give some example when you get a bug from this. Can't see it so far.

Changed in python-mode:
milestone: none → 6.1.1
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → Medium
status: New → Incomplete

I think that this bug is dependent on the order is which you load
various packgaes. If outline.el hasn't been parsed (and the defcustom
on line 57 hasn't been called) then the defvar in python-mode will set
outline-heading-end-regexp to nil which will eventually generate a
Lisp error: (wrong-type-argument stringp nil) in the bowels of
outline.el. If outline.el _has_ been evaluated (sorry, I don't know
all the correct lisp terms) before python-mode, then defvar is
harmless.

start with emacs -q

evaluate

(defvar outline-heading-end-regexp nil)
(require 'org-install)

in scratch

open any *.org file (that has at least 2 level of headers...I think
anything that will uses outline mode will work, but this is the one I
use)

expect: it to fold all but the top level headers without error
get: raises and error ( File mode specification error:
(wrong-type-argument stringp nil) ) and hides all the text

if you then evaluate

(setq outline-heading-end-regexp "\n")

[or set the value via customize] and re-load the .org file it behaves
as expected.

Tom

On Tue, Dec 18, 2012 at 12:08 AM, Andreas Roehler
<email address hidden> wrote:
> Please give some example when you get a bug from this. Can't see it so
> far.
>
> ** Changed in: python-mode
> Milestone: None => 6.1.1
>
> ** Changed in: python-mode
> Assignee: (unassigned) => Andreas Roehler (a-roehler)
>
> ** Changed in: python-mode
> Importance: Undecided => Medium
>
> ** Changed in: python-mode
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1091400
>
> Title:
> defvar of outline-heading-end-regexp breaks other packages
>
> Status in An Emacs mode for editing Python code:
> Incomplete
>
> Bug description:
> line 1321 of python-mode.el is:
>
> (defvar outline-heading-end-regexp nil)
>
> which breaks outline mode, which is used for other packages (like org-
> mode). This line should be removed.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/python-mode/+bug/1091400/+subscriptions

--
Thomas Caswell
<email address hidden>

Changed in python-mode:
status: Incomplete → In Progress
Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers