More triple quoting brokenness

Bug #328795 reported by Alito
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Unassigned

Bug Description

Is this related to the reason why all highlighting
after a line like the following line is broken?

print """')";"""

(btw, edloper, couldn't get your patch to go, but i'm
an emacs newbie so quite likely my fault)

[http://sourceforge.net/tracker/index.php?func=detail&aid=1024806&group_id=86916&atid=581349]

Related branches

Revision history for this message
Alito (alito) wrote :

That was meant to be a comment on the previous triple
comment thread

Revision history for this message
Edloper (edloper) wrote :

Yes, this patch [#1023335] should fix that problem.

As to having trouble getting my patch to work:

  - Did you apply it against rev 4.62 (the revision
    in python-mode cvs, not the one under files or
    included with python's cvs)

  - I'm not exactly an elisp guru, so it's not
    necessarily your fault -- there could be a bug
    in my code. :)

  - If you're still having trouble, please email me
    directly and I'll try to figure out what's wrong --
    I'm definitely interested in seeing if this works
    for other people. edloper at gradient dot cis
    dot upenn dot edu.

For posterity, here's a more complete description of the problem:

Currently, emacs mode has no special handling for triple quoted strings.

So if a triple quoted string contains an unmatched (and non-
backslashed) quote of the same type, then it's interpreted as a close
quote, and the number of quote marks gets off by one, so the final quote
of the triple quoted string is interpreted as an open quote.

I.e., for this text:

""" inside " outside """ inside

The regions marked 'inside' are colored as quotes. The normal work-
around is to backslash quotes in triple quoted strings, since a
backslashed
quote is just a quote:

""" inside \" inside """ outside

But this doesn't work for raw strings.

The referenced patch adds explicit handling for triple quoted strings, and

should solve these problems.

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

Hi Ed,

closing this bug, thank you.

Think your approach has been valid.

Andreas

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